Class Value
java.lang.Object
software.amazon.smithy.rulesengine.language.evaluation.value.Value
- All Implemented Interfaces:
- FromSourceLocation,- ToNode
- Direct Known Subclasses:
- ArrayValue,- BooleanValue,- EmptyValue,- EndpointValue,- IntegerValue,- RecordValue,- StringValue
An abstract representing a typed value.
- 
Method SummaryModifier and TypeMethodDescriptionstatic ArrayValuearrayValue(List<Value> value) Creates anArrayValuefrom a list of values.static BooleanValuebooleanValue(boolean value) Creates anBooleanValuefrom a boolean.static EmptyValueCreates anEmptyValue.static EndpointValueendpointValue(Node source) Creates anEndpointValuefrom a node.Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.static ValueCreates aValueof a specific type from the given Node information.Gets the source location of a value.abstract TypegetType()static IntegerValueintegerValue(int value) Creates anIntegerValuefrom an integer.booleanisEmpty()static RecordValuerecordValue(Map<Identifier, Value> value) Creates anRecordValuefrom a map of identifiers to values.static StringValuestringValue(String value) Creates anStringValuefrom a string.
- 
Method Details- 
getType
- 
fromNodeCreates aValueof a specific type from the given Node information.- Parameters:
- source- the node to deserialize.
- Returns:
- the created Value.
 
- 
isEmptypublic boolean isEmpty()
- 
getSourceLocationDescription copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
- getSourceLocationin interface- FromSourceLocation
- Returns:
- Returns the source location of the value.
 
- 
arrayValueCreates anArrayValuefrom a list of values.- Parameters:
- value- the list of values for the array.
- Returns:
- returns the created ArrayValue.
 
- 
booleanValueCreates anBooleanValuefrom a boolean.- Parameters:
- value- the value for the boolean.
- Returns:
- returns the created BooleanValue.
 
- 
emptyValueCreates anEmptyValue.- Returns:
- returns the created EmptyValue.
 
- 
endpointValueCreates anEndpointValuefrom a node.- Parameters:
- source- the node to create an endpoint from.
- Returns:
- returns the created EndpointValue.
 
- 
integerValueCreates anIntegerValuefrom an integer.- Parameters:
- value- the value for the integer.
- Returns:
- returns the created IntegerValue.
 
- 
recordValueCreates anRecordValuefrom a map of identifiers to values.- Parameters:
- value- the map to create a record from.
- Returns:
- returns the created RecordValue.
 
- 
stringValueCreates anStringValuefrom a string.- Parameters:
- value- the value for the string.
- Returns:
- returns the created StringValue.
 
- 
expectArrayValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns an array value.
 
- 
expectBooleanValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns a boolean value.
 
- 
expectEndpointValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns an endpoint value
 
- 
expectIntegerValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns an integer value.
 
- 
expectRecordValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns a record value.
 
- 
expectStringValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns a string value.
 
 
-