Class OptionalType
java.lang.Object
software.amazon.smithy.rulesengine.language.evaluation.type.OptionalType
- All Implemented Interfaces:
Type
The "optional" type, a container for a type that may or may not be present.
-
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.smithy.rulesengine.language.evaluation.type.Type
expectAnyType, expectArrayType, expectEmptyType, expectEndpointType, expectIntegerType, expectRecordType, expectTupleType
-
Method Details
-
isA
Description copied from interface:Type
Returns true if this type matches the target type.- Parameters:
type
- the target type to match.- Returns:
- true if the types match, false otherwise.
-
provenTruthy
Description copied from interface:Type
When used in the context of a condition, the condition can only match if the value was truthful. This means that a certain expression can be a different type, for example,OptionalType<T>
will becomeT
.- Returns:
- The type, given that it has been proven truthy
-
inner
Gets the optional's contained value.- Returns:
- the optional's value.
-
expectStringType
- Throws:
InnerParseError
-
expectBooleanType
- Throws:
InnerParseError
-
expectOptionalType
-
equals
-
hashCode
public int hashCode() -
toString
-