Record Class Statement

java.lang.Object
java.lang.Record
com.graphhopper.json.Statement

public record Statement(Statement.Keyword keyword, String condition, Statement.Op operation, String value, List<Statement> doBlock) extends Record
  • Constructor Details

    • Statement

      public Statement(Statement.Keyword keyword, String condition, Statement.Op operation, String value, List<Statement> doBlock)
      Creates an instance of a Statement record class.
      Parameters:
      keyword - the value for the keyword record component
      condition - the value for the condition record component
      operation - the value for the operation record component
      value - the value for the value record component
      doBlock - the value for the doBlock record component
  • Method Details

    • isBlock

      public boolean isBlock()
    • value

      public String value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • doBlock

      public List<Statement> doBlock()
      Returns the value of the doBlock record component.
      Returns:
      the value of the doBlock record component
    • toPrettyString

      public String toPrettyString()
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • If

      public static Statement If(String expression, List<Statement> doBlock)
    • If

      public static Statement If(String expression, Statement.Op op, String value)
    • ElseIf

      public static Statement ElseIf(String expression, List<Statement> doBlock)
    • ElseIf

      public static Statement ElseIf(String expression, Statement.Op op, String value)
    • Else

      public static Statement Else(List<Statement> doBlock)
    • Else

      public static Statement Else(Statement.Op op, String value)
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • keyword

      public Statement.Keyword keyword()
      Returns the value of the keyword record component.
      Returns:
      the value of the keyword record component
    • condition

      public String condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component
    • operation

      public Statement.Op operation()
      Returns the value of the operation record component.
      Returns:
      the value of the operation record component