Class ArcadeExpression

java.lang.Object
com.esri.arcgisruntime.arcade.ArcadeExpression
All Implemented Interfaces:
JsonSerializable

public final class ArcadeExpression extends Object implements JsonSerializable
An Arcade expression, containing an expression, a name, a return type and a title.

An ArcadeExpression object gathers an Arcade script expression together with:

  • the expected return type
  • the name that a map author uses to refer to it
  • the title that the author uses to describe the expression.
Since:
100.11.0
  • Constructor Details

  • Method Details

    • getExpression

      public String getExpression()
      Gets the Arcade expression string.
      Returns:
      the Arcade expression string
      Since:
      100.11.0
    • getName

      public String getName()
      Gets the name that the author uses to refer to the expression.

      If not set explicitly, then the default is an empty string.

      Returns:
      the name of the expression
      Since:
      100.11.0
    • getReturnType

      public ArcadeExpressionReturnType getReturnType()
      Gets the expected return type of the expression.

      If the arcade expression evaluates to a result which differs from ArcadeExpressionReturnType then the result will be cast to the expected return type. If the cast cannot be carried out, the result will be a type-specific error value. See ArcadeExpressionReturnType for details.

      Returns:
      the expected return type of the expression
      Since:
      100.11.0
    • getTitle

      public String getTitle()
      Gets the title that the author uses to describe the expression.

      If not set explicitly, then the default is an empty string.

      Returns:
      the title
      Since:
      100.11.0
    • equals

      public boolean equals(ArcadeExpression other)
      Tests if this object is equal to a second ArcadeExpression object.
      Parameters:
      other - the second object
      Returns:
      true if the comparison succeeds and the objects are equal, false otherwise
      Since:
      100.11.0
    • fromJson

      public static ArcadeExpression fromJson(String json)
      Creates an ArcadeExpression instance from a JSON string.
      Parameters:
      json - a JSON string that represents an ArcadeExpression
      Returns:
      an ArcadeExpression instance
      Throws:
      IllegalArgumentException - if json is null or empty
      Since:
      100.11.0
    • toJson

      public String toJson()
      Description copied from interface: JsonSerializable
      Serializes this object to a JSON string. Note that unknown JSON is omitted from the serialized string.
      Specified by:
      toJson in interface JsonSerializable
      Returns:
      a JSON string
    • getUnknownJson

      public Map<String,Object> getUnknownJson()
      Description copied from interface: JsonSerializable
      Gets unknown data from the source JSON.

      Unknown JSON is a Map of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.

      Specified by:
      getUnknownJson in interface JsonSerializable
      Returns:
      an unmodifiable Map containing unknown data from the source JSON
    • getUnsupportedJson

      public Map<String,Object> getUnsupportedJson()
      Description copied from interface: JsonSerializable
      Gets unsupported data from the source JSON.

      Unsupported JSON is a Map of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.

      Specified by:
      getUnsupportedJson in interface JsonSerializable
      Returns:
      an unmodifiable Map containing unsupported data from the source JSON