Interface RuntimeObjectModel
-
- All Known Implementing Classes:
AbstractRuntimeObjectModel
@ProviderType public interface RuntimeObjectModel
TheRuntimeObjectModelprovides various utility object inspection & conversion methods that can be applied to runtime objects when executing HTL scripts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisCollection(java.lang.Object target)Checks if an object is aCollectionor is backed by one.booleanisDate(java.lang.Object target)Checks if the provided object represents a date or calendar.booleanisNumber(java.lang.Object target)Checks if the provided object represents a number or not.booleanisPrimitive(java.lang.Object obj)Checks if the provided object represents a primitive data type or not.java.lang.ObjectresolveProperty(java.lang.Object target, java.lang.Object property)Resolve a property of a target object and return its value.booleantoBoolean(java.lang.Object object)Convert the given object to a boolean valuejava.util.Collection<java.lang.Object>toCollection(java.lang.Object object)Force the conversion of the object to a collectionjava.util.DatetoDate(java.lang.Object object)Convert the given object to aDateobjectjava.time.InstanttoInstant(java.lang.Object object)Convert the given object to anInstantobjectjava.util.MaptoMap(java.lang.Object object)Force the conversion of the target object to a mapjava.lang.NumbertoNumber(java.lang.Object object)Coerce the object to a numeric valuejava.lang.StringtoString(java.lang.Object target)Convert the given object to a string.
-
-
-
Method Detail
-
isPrimitive
boolean isPrimitive(java.lang.Object obj)
Checks if the provided object represents a primitive data type or not.- Parameters:
obj- the target object- Returns:
trueif thetargetis a primitive,falseotherwise
-
isCollection
boolean isCollection(java.lang.Object target)
Checks if an object is aCollectionor is backed by one.- Parameters:
target- the target object- Returns:
trueif thetargetis a collection or is backed by one,falseotherwise
-
isNumber
boolean isNumber(java.lang.Object target)
Checks if the provided object represents a number or not.- Parameters:
target- the target object- Returns:
trueif thetargetis a number,falseotherwise
-
isDate
boolean isDate(java.lang.Object target)
Checks if the provided object represents a date or calendar.- Parameters:
target- the target object- Returns:
trueif thetargetis a date or calendar,falseotherwise
-
resolveProperty
java.lang.Object resolveProperty(java.lang.Object target, java.lang.Object property)Resolve a property of a target object and return its value. The property can be either an index or a name- Parameters:
target- the target objectproperty- the property to be resolved- Returns:
- the value of the property
-
toBoolean
boolean toBoolean(java.lang.Object object)
Convert the given object to a boolean value- Parameters:
object- the target object- Returns:
- the boolean representation of that object
-
toNumber
java.lang.Number toNumber(java.lang.Object object)
Coerce the object to a numeric value- Parameters:
object- the target object- Returns:
- the numeric representation
-
toDate
java.util.Date toDate(java.lang.Object object)
Convert the given object to aDateobject- Parameters:
object- the target object- Returns:
- the date represented by the
object
-
toInstant
java.time.Instant toInstant(java.lang.Object object)
Convert the given object to anInstantobject- Parameters:
object- the target object- Returns:
- the date represented by the
object
-
toString
java.lang.String toString(java.lang.Object target)
Convert the given object to a string.- Parameters:
target- the target object- Returns:
- the string representation of the object
-
toCollection
java.util.Collection<java.lang.Object> toCollection(java.lang.Object object)
Force the conversion of the object to a collection- Parameters:
object- the target object- Returns:
- the collection representation of the object
-
toMap
java.util.Map toMap(java.lang.Object object)
Force the conversion of the target object to a map- Parameters:
object- the target object- Returns:
- a map representation of the object. Default is an empty map
-
-