Class Value
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.eval.Value
-
- All Implemented Interfaces:
FromSourceLocation,ToNode
- Direct Known Subclasses:
Value.Array,Value.Bool,Value.Endpoint,Value.Integer,Value.None,Value.Record,Value.String
public abstract class Value extends java.lang.Object implements FromSourceLocation, ToNode
An abstract representing a typed value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValue.Arraystatic classValue.Boolstatic classValue.Endpointstatic classValue.Integerstatic classValue.Nonestatic classValue.Recordstatic classValue.String
-
Constructor Summary
Constructors Constructor Description Value(SourceLocation sourceLocation)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Value.Arrayarray(java.util.List<Value> value)static Value.Boolbool(boolean value)static Value.EndpointendpointFromNode(Node source)Value.ArrayexpectArray()booleanexpectBool()Value.EndpointexpectEndpoint()intexpectInteger()Value.RecordexpectRecord()java.lang.StringexpectString()static ValuefromNode(Node source)SourceLocationgetSourceLocation()Gets the source location of a value.static Value.Integerinteger(int value)booleanisNone()static Valuenone()static Value.Recordrecord(java.util.Map<Identifier,Value> value)static Value.Stringstring(java.lang.String value)abstract Typetype()
-
-
-
Constructor Detail
-
Value
public Value(SourceLocation sourceLocation)
-
-
Method Detail
-
endpointFromNode
public static Value.Endpoint endpointFromNode(Node source)
-
none
public static Value none()
-
string
public static Value.String string(java.lang.String value)
-
record
public static Value.Record record(java.util.Map<Identifier,Value> value)
-
bool
public static Value.Bool bool(boolean value)
-
array
public static Value.Array array(java.util.List<Value> value)
-
integer
public static Value.Integer integer(int value)
-
type
public abstract Type type()
-
expectString
public java.lang.String expectString()
-
expectBool
public boolean expectBool()
-
getSourceLocation
public SourceLocation getSourceLocation()
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
expectRecord
public Value.Record expectRecord()
-
isNone
public boolean isNone()
-
expectEndpoint
public Value.Endpoint expectEndpoint()
-
expectArray
public Value.Array expectArray()
-
expectInteger
public int expectInteger()
-
-