aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/MaxLengthConstraint.java
diff options
context:
space:
mode:
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.java20
1 files changed, 5 insertions, 15 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 e1ad08faea..2535d972ca 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
@@ -17,21 +17,17 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdc.be.model.tosca.constraints;
-
-
+import java.util.List;
+import java.util.Map;
+import javax.validation.constraints.NotNull;
+import org.openecomp.sdc.be.model.PropertyConstraint;
import org.openecomp.sdc.be.model.tosca.ToscaType;
import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintFunctionalException;
-import org.openecomp.sdc.be.model.PropertyConstraint;
import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintViolationException;
import org.openecomp.sdc.be.model.tosca.constraints.exception.PropertyConstraintException;
-import javax.validation.constraints.NotNull;
-import java.util.List;
-import java.util.Map;
-
public class MaxLengthConstraint extends AbstractPropertyConstraint {
@NotNull
@@ -63,7 +59,6 @@ public class MaxLengthConstraint extends AbstractPropertyConstraint {
this.maxLength = maxLength;
}
-
@Override
public ConstraintType getConstraintType() {
return null;
@@ -71,20 +66,16 @@ public class MaxLengthConstraint extends AbstractPropertyConstraint {
@Override
public void validateValueOnUpdate(PropertyConstraint newConstraint) throws PropertyConstraintException {
-
}
-
@Override
public void validate(Object propertyValue) throws ConstraintViolationException {
if (propertyValue == null) {
throw new ConstraintViolationException("Value to validate is null");
}
-
- if(!(propertyValue instanceof String || propertyValue instanceof List || propertyValue instanceof Map)) {
+ if (!(propertyValue instanceof String || propertyValue instanceof List || propertyValue instanceof Map)) {
throw new ConstraintViolationException("This constraint can only be applied on String/List/Map value");
}
-
doValidate(propertyValue);
}
@@ -92,5 +83,4 @@ public class MaxLengthConstraint extends AbstractPropertyConstraint {
public String getErrorMessage(ToscaType toscaType, ConstraintFunctionalException e, String propertyName) {
return getErrorMessage(toscaType, e, propertyName, "%s maximum length must be [%s]", String.valueOf(maxLength));
}
-
}