Use String concatenation instead of StringBuffer/Builder
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / impl / DeviationBuilder.java
index afc16c5c0b7d3334f7e6066cc41349f720f21b3c..2aa509e08a7c24d65769918127e15dcd6d96d8cd 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.yangtools.yang.parser.builder.impl;
 
 import com.google.common.collect.ImmutableList;
 import java.util.List;
+import java.util.Objects;
 import org.opendaylight.yangtools.yang.model.api.Deviation;
 import org.opendaylight.yangtools.yang.model.api.Deviation.Deviate;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -17,6 +18,10 @@ import org.opendaylight.yangtools.yang.parser.builder.api.UnknownSchemaNodeBuild
 import org.opendaylight.yangtools.yang.parser.builder.util.AbstractBuilder;
 import org.opendaylight.yangtools.yang.parser.util.YangParseException;
 
+/**
+ * @deprecated Pre-Beryllium implementation, scheduled for removal.
+ */
+@Deprecated
 public final class DeviationBuilder extends AbstractBuilder {
     private DeviationImpl instance;
     private final SchemaPath targetPath;
@@ -111,14 +116,14 @@ public final class DeviationBuilder extends AbstractBuilder {
         public int hashCode() {
             final int prime = 31;
             int result = 1;
-            result = prime * result + ((targetPath == null) ? 0 : targetPath.hashCode());
-            result = prime * result + ((deviate == null) ? 0 : deviate.hashCode());
-            result = prime * result + ((reference == null) ? 0 : reference.hashCode());
+            result = prime * result + Objects.hashCode(targetPath);
+            result = prime * result + Objects.hashCode(deviate);
+            result = prime * result + Objects.hashCode(reference);
             return result;
         }
 
         @Override
-        public boolean equals(Object obj) {
+        public boolean equals(final Object obj) {
             if (this == obj) {
                 return true;
             }
@@ -155,13 +160,11 @@ public final class DeviationBuilder extends AbstractBuilder {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder(DeviationImpl.class.getSimpleName());
-            sb.append("[");
-            sb.append("targetPath=").append(targetPath);
-            sb.append(", deviate=").append(deviate);
-            sb.append(", reference=").append(reference);
-            sb.append("]");
-            return sb.toString();
+            return DeviationImpl.class.getSimpleName() + "[" +
+                    "targetPath=" + targetPath +
+                    ", deviate=" + deviate +
+                    ", reference=" + reference +
+                    "]";
         }
     }