java.lang.Object
software.amazon.smithy.rulesengine.language.evaluation.type.OptionalType
All Implemented Interfaces:
Type

public final class OptionalType extends Object
The "optional" type, a container for a type that may or may not be present.
  • Method Details

    • isA

      public boolean isA(Type type)
      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

      public Type 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 become T.
      Returns:
      The type, given that it has been proven truthy
    • inner

      public Type inner()
      Gets the optional's contained value.
      Returns:
      the optional's value.
    • expectStringType

      public StringType expectStringType() throws InnerParseError
      Throws:
      InnerParseError
    • expectBooleanType

      public BooleanType expectBooleanType() throws InnerParseError
      Throws:
      InnerParseError
    • expectOptionalType

      public OptionalType expectOptionalType()
    • equals

      public boolean equals(Object obj)
    • hashCode

      public int hashCode()
    • toString

      public String toString()