Class Condition

java.lang.Object
software.amazon.smithy.contracts.Condition
All Implemented Interfaces:
FromSourceLocation, ToNode, ToSmithyBuilder<Condition>

public final class Condition extends Object implements ToNode, ToSmithyBuilder<Condition>, FromSourceLocation
Defines an individual condition.
  • Method Details

    • toNode

      public Node toNode()
      Description copied from interface: ToNode
      Converts a value to a Node.
      Specified by:
      toNode in interface ToNode
      Returns:
      Returns the creates Node.
    • fromNode

      public static Condition fromNode(Node node)
      Creates a Condition from a Node.
      Parameters:
      node - Node to create the Condition from.
      Returns:
      Returns the created Condition.
      Throws:
      ExpectationNotMetException - if the given Node is invalid.
    • getSourceLocation

      public SourceLocation getSourceLocation()
      Description copied from interface: FromSourceLocation
      Gets the source location of a value.
      Specified by:
      getSourceLocation in interface FromSourceLocation
      Returns:
      Returns the source location of the value.
    • getExpression

      public JmespathExpression getExpression()
      JMESPath expression that must evaluate to true.
      Returns:
      Return the JMESPath expression.
    • getDocumentation

      public String getDocumentation()
      Documentation about the condition.
      Returns:
      Return the documentation.
    • toBuilder

      public Condition.Builder toBuilder()
      Description copied from interface: ToSmithyBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToSmithyBuilder<Condition>
      Returns:
      a builder for type T
    • builder

      public static Condition.Builder builder()
      Creates a builder used to build an equivalent Condition.
      Returns:
      the builder.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object