X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fstmt%2Frfc6020%2Feffective%2Ftype%2FLengthConstraintEffectiveImpl.java;h=98e11ecf65f328e030513e0b694ab7e4cea226fc;hb=635af1cfca70d0be0192f997c155d80cbbc5ba5d;hp=32ca55e4465b9722f164e380258eef9616044d28;hpb=594ac3953ed56d9fb2fa2c0a6129baf1f892bcc1;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/LengthConstraintEffectiveImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/LengthConstraintEffectiveImpl.java index 32ca55e446..98e11ecf65 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/LengthConstraintEffectiveImpl.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/LengthConstraintEffectiveImpl.java @@ -25,16 +25,20 @@ public class LengthConstraintEffectiveImpl implements LengthConstraint { public LengthConstraintEffectiveImpl(final Number min, final Number max, final Optional description, final Optional reference) { + this(min, max, description.orNull(), reference.orNull(), "length-out-of-specified-bounds", "The argument is out of bounds <" + + min + ", " + max + ">"); + } + public LengthConstraintEffectiveImpl(final Number min, final Number max, final String description, + final String reference, final String errorAppTag, final String errorMessage) { super(); - 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 = "length-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 : "length-out-of-specified-bounds"; + this.errorMessage = errorMessage != null ? errorMessage : "The argument is out of bounds <" + min + ", " + max + + ">"; } @Override