diff options
author | 2018-07-29 16:13:45 +0300 | |
---|---|---|
committer | 2018-07-29 16:20:34 +0300 | |
commit | 5b593496b8f1b8e8be8d7d2dbcc223332e65a49b (patch) | |
tree | 2f9dfc45191e723da69cf74be7829784e9741b94 /catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java | |
parent | 9200382f2ce7b4bb729aa287d0878004b2d2b4f9 (diff) |
re base code
Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5
Issue-ID: SDC-1566
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java index 142caa2017..8f54c68484 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractStringPropertyConstraint.java @@ -20,34 +20,27 @@ package org.openecomp.sdc.be.model.tosca.constraints; -import java.io.Serializable; - import org.openecomp.sdc.be.model.tosca.ToscaType; import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintValueDoNotMatchPropertyTypeException; import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintViolationException; -public abstract class AbstractStringPropertyConstraint extends AbstractPropertyConstraint implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 6857605164938136232L; - - protected abstract void doValidate(String propertyValue) throws ConstraintViolationException; - - @Override - public void validate(Object propertyValue) throws ConstraintViolationException { - if (propertyValue == null) { - throw new ConstraintViolationException("Value to validate is null"); - } - if (!(propertyValue instanceof String)) { - throw new ConstraintViolationException("This constraint can only be applied on String value"); - } - doValidate((String) propertyValue); - } - - @Override - public void initialize(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { - ConstraintUtil.checkStringType(propertyType); - } +public abstract class AbstractStringPropertyConstraint extends AbstractPropertyConstraint { + + protected abstract void doValidate(String propertyValue) throws ConstraintViolationException; + + @Override + public void validate(Object propertyValue) throws ConstraintViolationException { + if (propertyValue == null) { + throw new ConstraintViolationException("Value to validate is null"); + } + if (!(propertyValue instanceof String)) { + throw new ConstraintViolationException("This constraint can only be applied on String value"); + } + doValidate((String) propertyValue); + } + + @Override + public void initialize(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { + ConstraintUtil.checkStringType(propertyType); + } } |