Class ArrayValue
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.evaluation.value.Value
-
- software.amazon.smithy.rulesengine.language.evaluation.value.ArrayValue
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
public final class ArrayValue extends Value
An array of values of the same type.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
ArrayValue
expectArrayValue()
Returns the current value as anArrayValue
, throwingRuntimeException
when the value is the wrong type.Value
get(int index)
Gets the value at the index, or an empty value if none is present.Type
getType()
java.util.List<Value>
getValues()
Gets all the values in the array.int
hashCode()
Node
toNode()
Converts a value to aNode
.java.lang.String
toString()
-
Methods inherited from class software.amazon.smithy.rulesengine.language.evaluation.value.Value
arrayValue, booleanValue, emptyValue, endpointValue, expectBooleanValue, expectEndpointValue, expectIntegerValue, expectRecordValue, expectStringValue, fromNode, getSourceLocation, integerValue, isEmpty, recordValue, stringValue
-
-
-
-
Method Detail
-
getValues
public java.util.List<Value> getValues()
Gets all the values in the array.- Returns:
- the values in the array.
-
get
public Value get(int index)
Gets the value at the index, or an empty value if none is present.- Parameters:
index
- the index to get the value of.- Returns:
- the value at the index, or an empty value if not present.
-
expectArrayValue
public ArrayValue expectArrayValue()
Description copied from class:Value
Returns the current value as anArrayValue
, throwingRuntimeException
when the value is the wrong type.- Overrides:
expectArrayValue
in classValue
- Returns:
- returns an array value.
-
toNode
public Node toNode()
Description copied from interface:ToNode
Converts a value to aNode
.- Returns:
- Returns the creates Node.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-