Class Expression.ExpressionLiteral

java.lang.Object
com.trimblemaps.mapsdk.style.expressions.Expression
com.trimblemaps.mapsdk.style.expressions.Expression.ExpressionLiteral
Enclosing class:
Expression

public static class Expression.ExpressionLiteral extends Expression
ExpressionLiteral wraps an object to be used as a literal in an expression.

ExpressionLiteral is created with Expression.literal(Number), Expression.literal(boolean), Expression.literal(String) and Expression.literal(Object).

  • Field Details

    • literal

      protected Object literal
  • Constructor Details

    • ExpressionLiteral

      public ExpressionLiteral(@NonNull Object object)
      Create an expression literal.
      Parameters:
      object - the object to be treated as literal
  • Method Details

    • toValue

      public Object toValue()
      Get the literal object.
      Returns:
      the literal object
    • toArray

      @NonNull public Object[] toArray()
      Description copied from class: Expression
      Converts the expression to Object array representation.

      The output will later be converted to a JSON Object array.

      Overrides:
      toArray in class Expression
      Returns:
      the converted object array expression
    • toString

      public String toString()
      Returns a string representation of the expression literal.
      Overrides:
      toString in class Expression
      Returns:
      a string representation of the object.
    • equals

      public boolean equals(@Nullable Object o)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Expression
      Parameters:
      o - the other object
      Returns:
      true if equal, false if not
    • hashCode

      public int hashCode()
      Returns a hash code value for the expression literal.
      Overrides:
      hashCode in class Expression
      Returns:
      a hash code value for this expression literal