Interface IAttributeConfigurable<Self>

    • Method Detail

      • getAttribute

        default Object getAttribute​(String key)
        Gets a custom string attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        Returns:
        The value of the attribute, or null if no such attribute exists.
      • getAttribute

        default <T> T getAttribute​(String key,
                                   Class<T> type)
        Gets a custom string attribute associated with a certain key, if it is of a certain type. The exact meaning of these attributes is up to the user of the value descriptor API.
        Type Parameters:
        T - The expected type of the attribute.
        Parameters:
        key - The key of the attribute.
        type - The expected type of the attribute.
        Returns:
        The value of the attribute, or null if no such attribute exists or its value is not of the expected type.
      • getAttributes

        Map<String,​Object> getAttributes()
        Gets a map of additional custom attributes associated with this object. The exact meaning of these attributes is up to the user of the API.
        Returns:
        A map of additional attributes associated with this object.
      • getBooleanAttribute

        default Boolean getBooleanAttribute​(String key)
        Gets a custom boolean attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        Returns:
        The value of the attribute, or null if no such attribute exists or its value is not a boolean.
      • getBooleanAttribute

        default boolean getBooleanAttribute​(String key,
                                            boolean defaultValue)
        Gets a custom boolean attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        defaultValue - The default value to return if no such attribute exists or its value is not a boolean.
        Returns:
        The value of the attribute, or the default value if no such attribute exists or its value is not a boolean.
      • getFloatAttribute

        default Double getFloatAttribute​(String key)
        Gets a custom floating point number attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        Returns:
        The value of the attribute, or null if no such attribute exists or its value is not a floating point number.
      • getFloatAttribute

        default double getFloatAttribute​(String key,
                                         double defaultValue)
        Gets a custom floating point number attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        defaultValue - The default value to return if no such attribute exists or its value is not a floating point number.
        Returns:
        The value of the attribute, or the default if no such attribute exists or its value is not a floating point number.
      • getIntegerAttribute

        default Long getIntegerAttribute​(String key)
        Gets a custom integer attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        Returns:
        The value of the attribute, or null if no such attribute exists or its value is not an integer.
      • getIntegerAttribute

        default long getIntegerAttribute​(String key,
                                         long defaultValue)
        Gets a custom integer attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        defaultValue - The default value to return if no such attribute exists or its value is not an integer.
        Returns:
        The value of the attribute, or the default value if no such attribute exists or its value is not an integer.
      • getStringAttribute

        default String getStringAttribute​(String key)
        Gets a custom string attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        Returns:
        The value of the attribute, or null if no such attribute exists or its value is not a string.
      • getStringAttribute

        default String getStringAttribute​(String key,
                                          String defaultValue)
        Gets a custom string attribute associated with a certain key. The exact meaning of these attributes is up to the user of the value descriptor API.
        Parameters:
        key - The key of the attribute.
        defaultValue - The default value to return if no such attribute exists or its value is not a string.
        Returns:
        The value of the attribute, or the default value if no such attribute exists or its value is not a string.
      • withAddedAttribute

        Self withAddedAttribute​(String key,
                                Object value)
        Gets a new instance with the attribute at the given key changed to the given value.
        Parameters:
        key - The attribute key.
        value - The attribute value.
        Returns:
        A new instance with the new attribute.
      • withAddedAttributes

        Self withAddedAttributes​(Map<String,​Object> attributes)
        Gets a new instance with the attributes changed to the given map of attributes. Preserves other existing attributes and only adds or replaces the given ones.
        Parameters:
        attributes - The new attributes to add (or replace).
        Returns:
        A new instance with the current attributes plus the given attributes.
      • withAttributes

        Self withAttributes​(Map<String,​Object> attributes)
        Gets a new instance with the attributes changed to the given map of attributes. Replaces all existing attributes.
        Parameters:
        attributes - The new attributes.
        Returns:
        A new instance with the given attributes.