Package 

Interface HasAttributes


  • 
    public interface HasAttributes
    
                        

    Declares that a class contains Attributes and provides convenience functions to modify the attributes directly without needing to access the attributes property.

    • Method Detail

      • setAttribute

         abstract Unit setAttribute(String name, String value)

        Set or clear a string attribute. Passing null will remove the attribute.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, Long value)

        Set a long integer attribute.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, Integer value)

        Set an integer attribute.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, Double value)

        Set a floating point / double attribute.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, Boolean value)

        Set a boolean attribute.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, Array<String> value)

        Set or clear a string collection attribute. Passing null will remove the attribute.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, Collection<Object> value)

        Set a collection of primitive values as an attribute. Every element should be of the same type, and only String, Integer, Long, Double and Boolean are supported. If the collection contains mixed values, null, or any other type: the behavior is undefined.

      • setAttribute

         abstract Unit setAttribute(String name, IntArray value)

        Set an array of integer values.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, LongArray value)

        Set an array of long values.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to
      • setAttribute

         abstract Unit setAttribute(String name, DoubleArray value)

        Set an array of double values.

        Parameters:
        name - the attribute name
        value - the value to set the attribute to