diff options
Diffstat (limited to 'catalog-model')
2 files changed, 6 insertions, 6 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java index 35f036b9c6..91205359ce 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/GreaterOrEqualConstraint.java @@ -36,10 +36,10 @@ import org.openecomp.sdc.be.model.tosca.constraints.exception.PropertyConstraint @Setter @AllArgsConstructor @EqualsAndHashCode -public class GreaterOrEqualConstraint extends AbstractComparablePropertyConstraint { +public class GreaterOrEqualConstraint<T> extends AbstractComparablePropertyConstraint { @NotNull - private Object greaterOrEqual; + private T greaterOrEqual; @Override public void initialize(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { @@ -90,7 +90,7 @@ public class GreaterOrEqualConstraint extends AbstractComparablePropertyConstrai public void changeConstraintValueTypeTo(String propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { ToscaType toscaType = ToscaType.getToscaType(propertyType); try { - greaterOrEqual = toscaType.convert(String.valueOf(greaterOrEqual)); + greaterOrEqual = (T) toscaType.convert(String.valueOf(greaterOrEqual)); } catch (Exception e) { throw new ConstraintValueDoNotMatchPropertyTypeException( "greaterOrEqual constraint has invalid values <" + greaterOrEqual.toString() + "> property type is <" + propertyType + ">"); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/LessThanConstraint.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/LessThanConstraint.java index d071dbaa07..b2f5a47302 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/LessThanConstraint.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/constraints/LessThanConstraint.java @@ -36,10 +36,10 @@ import org.openecomp.sdc.be.model.tosca.constraints.exception.PropertyConstraint @Setter @AllArgsConstructor @EqualsAndHashCode -public class LessThanConstraint extends AbstractComparablePropertyConstraint { +public class LessThanConstraint<T> extends AbstractComparablePropertyConstraint { @NotNull - private Object lessThan; + private T lessThan; @Override public void initialize(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { @@ -90,7 +90,7 @@ public class LessThanConstraint extends AbstractComparablePropertyConstraint { public void changeConstraintValueTypeTo(String propertyType) throws ConstraintValueDoNotMatchPropertyTypeException { ToscaType toscaType = ToscaType.getToscaType(propertyType); try { - lessThan = toscaType.convert(String.valueOf(lessThan)); + lessThan = (T) toscaType.convert(String.valueOf(lessThan)); } catch (Exception e) { throw new ConstraintValueDoNotMatchPropertyTypeException( "lessThan constraint has invalid values <" + lessThan.toString() + "> property type is <" + propertyType + ">"); |