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
 
 public abstract class Value extends java.lang.Object implements FromSourceLocation, ToNode An abstract representing a typed value.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ArrayValuearrayValue(java.util.List<Value> value)Creates anArrayValuefrom a list of values.static BooleanValuebooleanValue(boolean value)Creates anBooleanValuefrom a boolean.static EmptyValueemptyValue()Creates anEmptyValue.static EndpointValueendpointValue(Node source)Creates anEndpointValuefrom a node.ArrayValueexpectArrayValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.BooleanValueexpectBooleanValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.EndpointValueexpectEndpointValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.IntegerValueexpectIntegerValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.RecordValueexpectRecordValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.StringValueexpectStringValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.static ValuefromNode(Node source)Creates aValueof a specific type from the given Node information.SourceLocationgetSourceLocation()Gets the source location of a value.abstract TypegetType()static IntegerValueintegerValue(int value)Creates anIntegerValuefrom an integer.booleanisEmpty()static RecordValuerecordValue(java.util.Map<Identifier,Value> value)Creates anRecordValuefrom a map of identifiers to values.static StringValuestringValue(java.lang.String value)Creates anStringValuefrom a string.
 
- 
- 
- 
Method Detail- 
getTypepublic abstract Type getType() 
 - 
fromNodepublic static Value fromNode(Node source) Creates aValueof a specific type from the given Node information.- Parameters:
- source- the node to deserialize.
- Returns:
- the created Value.
 
 - 
isEmptypublic boolean isEmpty() 
 - 
getSourceLocationpublic SourceLocation getSourceLocation() Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
- getSourceLocationin interface- FromSourceLocation
- Returns:
- Returns the source location of the value.
 
 - 
arrayValuepublic static ArrayValue arrayValue(java.util.List<Value> value) Creates anArrayValuefrom a list of values.- Parameters:
- value- the list of values for the array.
- Returns:
- returns the created ArrayValue.
 
 - 
booleanValuepublic static BooleanValue booleanValue(boolean value) Creates anBooleanValuefrom a boolean.- Parameters:
- value- the value for the boolean.
- Returns:
- returns the created BooleanValue.
 
 - 
emptyValuepublic static EmptyValue emptyValue() Creates anEmptyValue.- Returns:
- returns the created EmptyValue.
 
 - 
endpointValuepublic static EndpointValue endpointValue(Node source) Creates anEndpointValuefrom a node.- Parameters:
- source- the node to create an endpoint from.
- Returns:
- returns the created EndpointValue.
 
 - 
integerValuepublic static IntegerValue integerValue(int value) Creates anIntegerValuefrom an integer.- Parameters:
- value- the value for the integer.
- Returns:
- returns the created IntegerValue.
 
 - 
recordValuepublic static RecordValue recordValue(java.util.Map<Identifier,Value> value) Creates anRecordValuefrom a map of identifiers to values.- Parameters:
- value- the map to create a record from.
- Returns:
- returns the created RecordValue.
 
 - 
stringValuepublic static StringValue stringValue(java.lang.String value) Creates anStringValuefrom a string.- Parameters:
- value- the value for the string.
- Returns:
- returns the created StringValue.
 
 - 
expectArrayValuepublic ArrayValue expectArrayValue() Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns an array value.
 
 - 
expectBooleanValuepublic BooleanValue expectBooleanValue() Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns a boolean value.
 
 - 
expectEndpointValuepublic EndpointValue expectEndpointValue() Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns an endpoint value
 
 - 
expectIntegerValuepublic IntegerValue expectIntegerValue() Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns an integer value.
 
 - 
expectRecordValuepublic RecordValue expectRecordValue() Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns a record value.
 
 - 
expectStringValuepublic StringValue expectStringValue() Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Returns:
- returns a string value.
 
 
- 
 
-