Interface Value
-
- All Known Implementing Classes:
BaseDelayedValue,BaseNumericValue,BaseValue,BigDecimalValue,DateTimeValue,DoubleValue,LongValue,StringValue
public interface ValueWrapper for a typed primitive value used within the expression evaluation engine. Note that the "Null" value is represented by an actual Value instance with the type ofValue.Type.NULL. Also note that all the conversion methods will throw anEvalExceptionif the conversion is not supported for the current value.- Author:
- James Ahlborn
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classValue.Typethe types supported within the expression evaluation engine
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectget()BigDecimalgetAsBigDecimal(LocaleContext ctx)booleangetAsBoolean(LocaleContext ctx)ValuegetAsDateTimeValue(LocaleContext ctx)Since date/time values have different types, it may be more convenient to get the date/time primitive value with the appropriate type information.DoublegetAsDouble(LocaleContext ctx)LocalDateTimegetAsLocalDateTime(LocaleContext ctx)IntegergetAsLongInt(LocaleContext ctx)StringgetAsString(LocaleContext ctx)Value.TypegetType()booleanisNull()
-
-
-
Method Detail
-
getType
Value.Type getType()
- Returns:
- the type of this value
-
get
Object get()
- Returns:
- the raw primitive value
-
isNull
boolean isNull()
- Returns:
trueif this value represents a "Null" value,falseotherwise.
-
getAsBoolean
boolean getAsBoolean(LocaleContext ctx)
- Returns:
- this primitive value converted to a boolean
-
getAsString
String getAsString(LocaleContext ctx)
- Returns:
- this primitive value converted to a String
-
getAsLocalDateTime
LocalDateTime getAsLocalDateTime(LocaleContext ctx)
- Returns:
- this primitive value converted to a LocalDateTime
-
getAsDateTimeValue
Value getAsDateTimeValue(LocaleContext ctx)
Since date/time values have different types, it may be more convenient to get the date/time primitive value with the appropriate type information.- Returns:
- this value converted to a date/time value
-
getAsLongInt
Integer getAsLongInt(LocaleContext ctx)
- Returns:
- this primitive value converted (rounded) to an int
-
getAsDouble
Double getAsDouble(LocaleContext ctx)
- Returns:
- this primitive value converted (rounded) to a double
-
getAsBigDecimal
BigDecimal getAsBigDecimal(LocaleContext ctx)
- Returns:
- this primitive value converted to a BigDecimal
-
-