diff options
Diffstat (limited to 'catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java index b6a80afced..8b7ce49cbc 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java @@ -20,42 +20,35 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import java.io.Serializable; - -import javax.validation.constraints.NotNull; - import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintViolationException; -public class MaxLengthConstraint extends AbstractStringPropertyConstraint implements Serializable { +import javax.validation.constraints.NotNull; - /** - * - */ - private static final long serialVersionUID = 6377603705670201256L; +public class MaxLengthConstraint extends AbstractStringPropertyConstraint { - @NotNull - private Integer maxLength; + @NotNull + private Integer maxLength; - public MaxLengthConstraint(Integer maxLength) { - this.maxLength = maxLength; - } + public MaxLengthConstraint(Integer maxLength) { + this.maxLength = maxLength; + } - public MaxLengthConstraint() { - super(); - } + public MaxLengthConstraint() { + super(); + } - @Override - protected void doValidate(String propertyValue) throws ConstraintViolationException { - if (propertyValue.length() > maxLength) { - throw new ConstraintViolationException("The length of the value is greater than [" + maxLength + "]"); - } - } + @Override + protected void doValidate(String propertyValue) throws ConstraintViolationException { + if (propertyValue.length() > maxLength) { + throw new ConstraintViolationException("The length of the value is greater than [" + maxLength + "]"); + } + } - public Integer getMaxLength() { - return maxLength; - } + public Integer getMaxLength() { + return maxLength; + } - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } + public void setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + } } |