public final class ConstraintUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ConstraintUtil.ConstraintInformation |
Modifier and Type | Method and Description |
---|---|
static void |
checkComparableType(ToscaType propertyType)
Verify that the given tosca type is supported for comparison
|
static void |
checkStringType(ToscaType propertyType)
Validates that the
ToscaType specified is a
ToscaType.STRING . |
static Comparable |
convertToComparable(ToscaType propertyType,
String value)
Convert a string value following its type throw exception if it cannot be
converted to a comparable
|
static ConstraintUtil.ConstraintInformation |
getConstraintInformation(Object constraint) |
public static void checkStringType(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException
ToscaType
specified is a
ToscaType.STRING
.propertyType
- The property tosca type.ConstraintValueDoNotMatchPropertyTypeException
- In case the type is not ToscaType.STRING
.public static void checkComparableType(ToscaType propertyType) throws ConstraintValueDoNotMatchPropertyTypeException
propertyType
- the tosca type to checkConstraintValueDoNotMatchPropertyTypeException
- if the property type cannot be comparedpublic static Comparable convertToComparable(ToscaType propertyType, String value) throws ConstraintValueDoNotMatchPropertyTypeException
propertyType
- the type of the propertyvalue
- the value to convertConstraintValueDoNotMatchPropertyTypeException
- if the converted value is not a comparablepublic static ConstraintUtil.ConstraintInformation getConstraintInformation(Object constraint) throws IntrospectionException
IntrospectionException
Copyright © 2017. All rights reserved.