AttributeAccessors, providing
a base implementation of all methods. To be extended by subclasses.
Serializable if subclasses and all attribute values are Serializable.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | attributes
Map with String keys and Object values. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | attributeNames()
Implements org. Return the names of all attributes. |
| public <T> T | computeAttribute(String
the unique attribute key name, Function<String, T> a function that computes a new value for the attribute
name; the function must not return a computeFunction)null valueOverrides default org. Compute a new value for the attribute identified by |
| protected void | copyAttributesFrom(AttributeAccessor
the AttributeAccessor to copy from source)Copy the attributes from the supplied AttributeAccessor to this accessor. |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public Object | getAttribute(String
the unique attribute key name)Implements org. Get the value of the attribute identified by |
| public boolean | hasAttribute(String
the unique attribute key name)Implements org. Return |
| public int | |
| public Object | removeAttribute(String
the unique attribute key name)Implements org. Remove the attribute identified by |
| public void | setAttribute(String
the unique attribute key name, Object the attribute value to be attached value)Implements org. Set the attribute defined by |
| attributes | back to summary |
|---|---|
| private final Map<String, Object> attributes Map with String keys and Object values. | |
| AttributeAccessorSupport | back to summary |
|---|---|
| public AttributeAccessorSupport() | |
| attributeNames | back to summary |
|---|---|
| public String[] attributeNames() Implements org. Doc from org. Return the names of all attributes.
| |
| computeAttribute | back to summary |
|---|---|
| public <T> T computeAttribute(String name, Function<String, T> computeFunction) Overrides default org. Doc from org. Compute a new value for the attribute identified by If a value for the attribute identified by The default implementation of this method is not thread safe but can be overridden by concrete implementations of this interface.
| |
| copyAttributesFrom | back to summary |
|---|---|
| protected void copyAttributesFrom(AttributeAccessor source) Copy the attributes from the supplied AttributeAccessor to this accessor.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Implements org. Doc from org. Get the value of the attribute identified by Return | |
| hasAttribute | back to summary |
|---|---|
| public boolean hasAttribute(String name) Implements org. Doc from org. Return Otherwise return | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(String name) Implements org. Doc from org. Remove the attribute identified by Return | |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(String name, Object value) Implements org. Doc from org. Set the attribute defined by If In general, users should take care to prevent overlaps with other metadata attributes by using fully-qualified names, perhaps using class or package names as prefix. | |