Class 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, gives detail information about what this UniqueValue does or represents.
    • Label, name that this UniqueValue can be referred to.
    • Symbol, the Symbol that this UniqueValue uses to draw its values to the GeoView.
    • Values, represent certain Features/Graphics 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 Detail

      • 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 UniqueValue.

        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
        label - the label for this UniqueValue, can be null
        symbol - symbol to be used for rendering values within this UniqueValue, can be null
        values - values to which the Symbol for this UniqueValue will be applied, can be null
        Since:
        100.0.0
    • Method Detail

      • 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
        If this object was created from JSON, this method gets unknown data from the source JSON. Unknown JSON is a Map of values that were in the source JSON but are not known by the Runtime and therefore not exposed in the API.
        Specified by:
        getUnknownJson in interface JsonSerializable
        Returns:
        an unmodifiable Map containing unknown JSON data. The keys are Strings containing names. The types of the values depend on the types of tokens within the JSON as follows:
        • a Map<String, Object> represents an object in the JSON
        • a List<Object> represents an array in the JSON
        • a String represents a string in the JSON
        • a Double represents a number in the JSON
        • a Boolean represents true or false in the JSON
        • null represents null in the JSON
      • getUnsupportedJson

        public Map<String,Object> getUnsupportedJson()
        Description copied from interface: JsonSerializable
        If this object was created from JSON, this method gets unsupported data from the source JSON. Unsupported JSON is a Map of values that are supported by webmaps and known to the version of the webmap specification the API supports (see system requirements), but are not explicitly exposed through the Runtime API.
        Specified by:
        getUnsupportedJson in interface JsonSerializable
        Returns:
        an unmodifiable Map containing unsupported JSON data. The keys are Strings containing names. The types of the values depend on the types of tokens within the JSON as follows:
        • a Map<String, Object> represents an object in the JSON
        • a List<Object> represents an array in the JSON
        • a String represents a string in the JSON
        • a Double represents a number in the JSON
        • a Boolean represents true or false in the JSON
        • null represents null in the 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(java.lang.String)
      • setDescription

        public void setDescription​(String description)
        Sets the description, which gives detail information about what this UniqueValue does or represents. An example could be describing the meaning behind the Symbol this UniqueValue uses.
        Parameters:
        description - the description to be used for this UniqueValue
        Since:
        100.0.0
      • 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
      • setLabel

        public void setLabel​(String label)
        Sets a name that this UniqueValue can be referred to.
        Parameters:
        label - the label to be used for this UniqueValue
        Since:
        100.0.0
      • 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
      • 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