public final class ExpressionOasisHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertCorrectExpressionContext(ExpressionContext expressionContext,
Class<?> assertingClass)
Asserts that the given expression context instance is a
CustomExpressionContext
instance. |
static boolean |
hasCompositeType(ValueObject valueObject)
Gets whether the given value object has a composite type.
|
static boolean |
hasNumericType(ValueObject valueObject)
Gets whether the given value object has a numeric type.
This method call is equivalent to (in case no exception occurs) calling isNumericType(valueObject.getValueType()). |
static boolean |
isNumericType(Type type)
Gets whether the given type is numeric.
|
static boolean |
typesEqual(Type first,
Type second)
Convenience method to check whether the given two type instances are equal.
|
public static boolean hasNumericType(ValueObject valueObject)
isNumericType(valueObject.getValueType()).valueObject - A ValueObject.true if the given value object has a numeric type, false otherwise.NullPointerException - In case the passed value object is null.isNumericType(Type)public static boolean isNumericType(Type type)
type - The Type instance to checktrue if the passed type is equal to Type#Double, Type.INTEGER
, Type.LONG, Type.FLOAT, Type.SHORT or Type.BYTE.NullPointerException - In case the passed type is null.public static boolean typesEqual(Type first, Type second)
first - A Type instance.second - A Type instance.true if both type instances are equal, otherwise false.NullPointerException - In case either of the passed types is null.public static boolean hasCompositeType(ValueObject valueObject)
valueObject - A ValueObject instance.true iff the given value object is a
MeasuredValuesCompositeValueObject instance, false otherwise.NullPointerException - In case the passed value object is null.public static void assertCorrectExpressionContext(ExpressionContext expressionContext, Class<?> assertingClass)
CustomExpressionContext
instance.expressionContext - The ExpressionContext to check.assertingClass - The Class of the object which is calling this method.AssertionError - In case the given expression context is not a CustomExpressionContext
instance.