public final class Attribute<T> extends Object implements Cloneable
AttributeDefinition
.
An attribute contains an optional value (or defers to its AttributeDefinition for the default value). It is possible to determine whether
a value has been changed with respect to its initial value. An Attribute remains modifiable until it is protected. At which point it can only
be modified if its AttributeDefinition allows it to be mutable. Additionally it is possible to register listeners when values change so that
code can react to these changes.Modifier and Type | Method and Description |
---|---|
void |
addListener(AttributeListener<T> listener) |
<K> K |
asObject() |
protected Attribute<T> |
clone() |
boolean |
equals(Object obj) |
T |
get() |
AttributeDefinition<T> |
getAttributeDefinition() |
T |
getInitialValue() |
int |
hashCode() |
boolean |
isImmutable() |
boolean |
isModified() |
boolean |
isNull() |
String |
name() |
Attribute<T> |
protect() |
void |
read(Attribute<T> other) |
void |
reset() |
void |
set(T value) |
String |
toString() |
void |
validate() |
protected T value
public String name()
public T get()
public T getInitialValue()
public void validate()
public void set(T value)
public boolean isImmutable()
public boolean isModified()
public <K> K asObject()
public void addListener(AttributeListener<T> listener)
public boolean isNull()
public AttributeDefinition<T> getAttributeDefinition()
public void reset()
Copyright © 2023 JBoss, a division of Red Hat. All rights reserved.