Class RecordValue
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.evaluation.value.Value
-
- software.amazon.smithy.rulesengine.language.evaluation.value.RecordValue
-
- All Implemented Interfaces:
FromSourceLocation,ToNode
public final class RecordValue extends Value
A record value, containing a map of identifiers to other values.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)RecordValueexpectRecordValue()Returns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.Valueget(java.lang.String key)Gets the value in the record for the provided key.Valueget(Identifier key)Gets the value in the record for the provided key.TypegetType()java.util.Map<Identifier,Value>getValue()Gets the map of identifiers to other values.inthashCode()NodetoNode()Converts a value to aNode.java.lang.StringtoString()-
Methods inherited from class software.amazon.smithy.rulesengine.language.evaluation.value.Value
arrayValue, booleanValue, emptyValue, endpointValue, expectArrayValue, expectBooleanValue, expectEndpointValue, expectIntegerValue, expectStringValue, fromNode, getSourceLocation, integerValue, isEmpty, recordValue, stringValue
-
-
-
-
Method Detail
-
getValue
public java.util.Map<Identifier,Value> getValue()
Gets the map of identifiers to other values.- Returns:
- the map of identifiers to other values.
-
get
public Value get(java.lang.String key)
Gets the value in the record for the provided key.- Parameters:
key- the key to retrieve a value for.- Returns:
- the value for the provided key, or null if the key is not present.
-
get
public Value get(Identifier key)
Gets the value in the record for the provided key.- Parameters:
key- the key to retrieve a value for.- Returns:
- the value for the provided key, or null if the key is not present.
-
expectRecordValue
public RecordValue expectRecordValue()
Description copied from class:ValueReturns the current value as anArrayValue, throwingRuntimeExceptionwhen the value is the wrong type.- Overrides:
expectRecordValuein classValue- Returns:
- returns a record value.
-
toNode
public Node toNode()
Description copied from interface:ToNodeConverts a value to aNode.- Returns:
- Returns the creates Node.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-