Remove explicit default super-constructor calls
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / RangeConstraintEffectiveImpl.java
index 4308ecb07b80cca83b9ac4f6762f04f65c31c1d4..25a1a1e240a16b5ad8e9de0d8c0e177e54eb366e 100644 (file)
@@ -26,16 +26,19 @@ public class RangeConstraintEffectiveImpl implements RangeConstraint {
 
     public RangeConstraintEffectiveImpl(final Number min, final Number max, final Optional<String> description,
             final Optional<String> reference) {
+        this(min, max, description.orNull(), reference.orNull(), "range-out-of-specified-bounds",
+                "The argument is out of bounds <" + min + ", " + max + ">");
+    }
 
-        super();
-
+    public RangeConstraintEffectiveImpl(final Number min, final Number max, final String description,
+            final String reference, final String errorAppTag, final String errorMessage) {
         this.min = Preconditions.checkNotNull(min, "min must not be null.");
         this.max = Preconditions.checkNotNull(max, "max must not be null.");
-        this.description = description.orNull();
-        this.reference = reference.orNull();
-
-        this.errorAppTag = "range-out-of-specified-bounds";
-        this.errorMessage = "The argument is out of bounds <" + min + ", " + max + ">";
+        this.description = description;
+        this.reference = reference;
+        this.errorAppTag = errorAppTag != null ? errorAppTag : "range-out-of-specified-bounds";
+        this.errorMessage = errorMessage != null ? errorMessage : "The argument is out of bounds <" + min + ", " + max
+                + ">";
     }
 
     @Override
@@ -110,21 +113,8 @@ public class RangeConstraintEffectiveImpl implements RangeConstraint {
 
     @Override
     public String toString() {
-        final StringBuilder builder = new StringBuilder();
-        builder.append(RangeConstraintEffectiveImpl.class.getSimpleName());
-        builder.append(" [min=");
-        builder.append(min);
-        builder.append(", max=");
-        builder.append(max);
-        builder.append(", description=");
-        builder.append(description);
-        builder.append(", reference=");
-        builder.append(reference);
-        builder.append(", errorAppTag=");
-        builder.append(errorAppTag);
-        builder.append(", errorMessage=");
-        builder.append(errorMessage);
-        builder.append("]");
-        return builder.toString();
+        return RangeConstraintEffectiveImpl.class.getSimpleName() + " [min=" + min + ", max=" + max + ", description="
+                + description + ", reference=" + reference + ", errorAppTag=" + errorAppTag + ", errorMessage="
+                + errorMessage + "]";
     }
 }