Add support for comparable type constraints for strings 25/132625/2
authorvasraz <vasyl.razinkov@est.tech>
Wed, 7 Dec 2022 17:05:26 +0000 (17:05 +0000)
committerMichael Morris <michael.morris@est.tech>
Mon, 12 Dec 2022 13:50:50 +0000 (13:50 +0000)
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: I3b52c720968ab8333fa2ec81b13c3d0e7b2f4316
Issue-ID: SDC-4299

catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/AbstractComparablePropertyConstraint.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/ConstraintUtil.java

index e7730bd..d7eb6e6 100644 (file)
@@ -33,9 +33,7 @@ public abstract class AbstractComparablePropertyConstraint extends AbstractPrope
     }
 
     protected void initialize(String rawTextValue, ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException {
-        // Perform verification that the property type is supported for
-
-        // comparison
+        // Perform verification that the property type is supported for comparison
         ConstraintUtil.checkComparableType(propertyType);
         // Check if the text value is valid for the property type
         if (propertyType.isValidValue(rawTextValue)) {
index 74a9359..1b9b94e 100644 (file)
@@ -60,20 +60,15 @@ public final class ConstraintUtil {
      * @throws ConstraintValueDoNotMatchPropertyTypeException if the property type cannot be compared
      */
     public static void checkComparableType(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException {
-        // The validity of the value is already assured by us with our
-
-        // ToscaType.convert() method
-
-        // here we just want to check that the constraint is not used on
-
-        // unsupported type as boolean
+        // The validity of the value is already assured by us with our ToscaType.convert() method
+        // here we just want to check that the constraint is not used on unsupported type as boolean
         switch (propertyType) {
             case FLOAT:
             case INTEGER:
             case TIMESTAMP:
             case VERSION:
-                break;
             case STRING:
+                break;
             case BOOLEAN:
                 throw new ConstraintValueDoNotMatchPropertyTypeException("Constraint is invalid for property type <" + propertyType.toString() + ">");
             default: