Class UniqueValueRenderer.UniqueValue

java.lang.Object
com.esri.arcgisruntime.symbology.UniqueValueRenderer.UniqueValue
All Implemented Interfaces:
JsonSerializable
Enclosing class:
UniqueValueRenderer

public static final class UniqueValueRenderer.UniqueValue extends Object implements JsonSerializable
A UniqueValue object that is used in a UniqueValueRenderer.

UniqueValues are used for assigning certain values to a certain Symbol. It also allows for a description and label to be assigned to those values as well.

Properties of a UniqueValue:

  • Description - describes what the UniqueValue does or represents.
  • Label - name that this UniqueValue can be referred by.
  • Symbol - the Symbol to display.
  • Values - represent certain geoelements and will have the Symbol for this UniqueValue applied to them.

Note: Values is a iterable list and the contents of this list are copied. Any subsequent changes to this list won't have any impact on the values of this object. To modify the values, use the corresponding get method for its result is modifiable.

Since:
100.0.0
  • Constructor Details

    • UniqueValue

      public UniqueValue()
      Creates a new UniqueValue with given default properties:
      • Description, an empty string.
      • Label - null.
      • Symbol - an empty string.
      • Values - an empty iterable list.

      Only Symbol and values needs to be set for this UniqueValue to work; description and label are optional. If values is set and Symbol is still null, then when this UniqueValue is rendered, nothing will be displayed to the GeoView even if a default Symbol is set.

      Since:
      100.0.0
    • UniqueValue

      public UniqueValue(String description, String label, Symbol symbol, Iterable<Object> values)
      Creates a new unique value (or unique combination of values) and a symbol used to display elements with this value in a UniqueValueRenderer.

      Setting any parameter to null will set it to its default property, see UniqueValue() for more information.

      Parameters:
      description - the description for this UniqueValue. Can be null. For example: "Parcels zoned for residential use".
      label - the label for this UniqueValue. Can be null. For example: "Residential".
      symbol - symbol to be used for rendering values within this UniqueValue. Can be null.
      values - a unique value or unique combination of values to which the Symbol for this UniqueValue will be applied. Can be null.
      Since:
      100.0.0
    • UniqueValue

      public UniqueValue(String description, String label, Symbol symbol, Iterable<Object> values, Iterable<Symbol> alternateSymbols)
      Creates a new unique value (or unique combination of values) object with alternate symbols.

      A unique value can have alternate symbols to the primary symbol. Alternate symbols allow you to tailor the visualization of unique value at different scales by selecting different symbol for different scales. Alternate symbols are supported only when unique value's primary symbol and other symbols in alternate symbol list are of type MultilayerSymbol and have SymbolReferenceProperties defining valid min max scales at which the symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale. For more information on Scale-based symbol classes and alternate symbols see the "Scale based Symbols documentation"

      Parameters:
      description - a description of the unique value. "Parcels zoned for residential use", for example.
      label - a label for the unique value. "Residential", for example.
      symbol - a symbol used to represent elements with this unique value, may be null
      values - a Iterable containing Object types that define a unique value or unique combination of values
      alternateSymbols - the alternate symbols for the unique value. Only MultilayerSymbol are supported as alternates. This param may be null.
      Since:
      100.13.0
  • Method Details

    • getAlternateSymbols

      public List<Symbol> getAlternateSymbols()
      Gets the alternate symbols for the unique value's primary symbol. Symbols in this list should be of type MultilayerSymbol and must have SymbolReferenceProperties set with valid minimum and maximum scale at which symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale.
      Returns:
      the alternate symbols for the unique value's primary symbol.
      Since:
      100.13.0
    • fromJson

      public static UniqueValueRenderer.UniqueValue fromJson(String json)
      Creates a UniqueValue instance from a JSON string.
      Parameters:
      json - a JSON string that represents a UniqueValue
      Returns:
      a UniqueValue instance
      Throws:
      IllegalArgumentException - if json is null or empty
      Since:
      100.0.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
    • getDescription

      public String getDescription()
      Gets the description that describes what this UniqueValue does or represents.

      Default value is an empty string.

      Returns:
      the description used by this UniqueValue
      Since:
      100.0.0
      See Also:
    • setDescription

      public void setDescription(String description)
      Sets the description, which gives detail information about what this UniqueValue does or represents. For example: "Parcels zoned for residential use". The description often describes the meaning behind the Symbol this UniqueValue uses.
      Parameters:
      description - the description to be used for this UniqueValue
      Since:
      100.0.0
      See Also:
    • getLabel

      public String getLabel()
      Gets the name that this UniqueValue is referred as.

      Default value is an empty string.

      Returns:
      the label for this UniqueValue
      Since:
      100.0.0
      See Also:
    • setLabel

      public void setLabel(String label)
      Sets a name that this UniqueValue can be referred to. For example: "Residential".
      Parameters:
      label - the label to be used for this UniqueValue
      Since:
      100.0.0
      See Also:
    • getSymbol

      public Symbol getSymbol()
      Gets the Symbol that this UniqueValue uses to represent the values (geoelements).

      Default value is null.

      Returns:
      the Symbol this UniqueValue is using
      Since:
      100.0.0
      See Also:
    • setSymbol

      public void setSymbol(Symbol symbol)
      Sets the Symbol for this UniqueValue.

      This Symbol will be applied to the values stored in this UniqueValue.

      If the Symbol is null, then this UniqueValue will not be displayed on the GeoView when rendered.

      Parameters:
      symbol - the Symbol this UniqueValue is going to use. Can be null.
      Since:
      100.0.0
      See Also:
    • getValues

      public List<Object> getValues()
      Gets a modifiable list containing all the values that the Symbol for this UniqueValue will be applied to.
      Returns:
      a List containing all the values that where added to this UniqueValue.
      Since:
      100.0.0