-
public interface HasAttributesDeclares that a class contains Attributes and provides convenience functions to modify the attributes directly without needing to access the attributes property.
-
-
Method Summary
Modifier and Type Method Description abstract UnitsetAttribute(String name, String value)Set or clear a string attribute. abstract UnitsetAttribute(String name, Long value)Set a long integer attribute. abstract UnitsetAttribute(String name, Integer value)Set an integer attribute. abstract UnitsetAttribute(String name, Double value)Set a floating point / double attribute. abstract UnitsetAttribute(String name, Boolean value)Set a boolean attribute. abstract UnitsetAttribute(String name, Array<String> value)Set or clear a string collection attribute. abstract UnitsetAttribute(String name, Collection<Object> value)Set a collection of primitive values as an attribute. abstract UnitsetAttribute(String name, IntArray value)Set an array of integer values. abstract UnitsetAttribute(String name, LongArray value)Set an array of long values. abstract UnitsetAttribute(String name, DoubleArray value)Set an array of double values. -
-
Method Detail
-
setAttribute
abstract Unit setAttribute(String name, String value)
Set or clear a string attribute. Passing
nullwill remove the attribute.- Parameters:
name- the attribute namevalue- the value to set the attribute to
-
setAttribute
abstract Unit setAttribute(String name, Long value)
Set a long integer attribute.
- Parameters:
name- the attribute namevalue- the value to set the attribute to
-
setAttribute
abstract Unit setAttribute(String name, Integer value)
Set an integer attribute.
- Parameters:
name- the attribute namevalue- 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 namevalue- the value to set the attribute to
-
setAttribute
abstract Unit setAttribute(String name, Boolean value)
Set a boolean attribute.
- Parameters:
name- the attribute namevalue- the value to set the attribute to
-
setAttribute
abstract Unit setAttribute(String name, Array<String> value)
Set or clear a string collection attribute. Passing
nullwill remove the attribute.- Parameters:
name- the attribute namevalue- 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 namevalue- 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 namevalue- 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 namevalue- the value to set the attribute to
-
-
-
-