Class Attribute<T>
java.lang.Object
org.infinispan.commons.configuration.attributes.Attribute<T>
public final class Attribute<T>
extends Object
implements Cloneable, Matchable<Attribute<?>>, Updatable<Attribute<T>>
Attribute. This class implements a configuration attribute value holder. A configuration attribute is defined by an
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.- Since:
- 7.2
- Author:
- Tristan Tarrant
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(AttributeListener<T> listener) void
clone()
computeIfAbsent
(Supplier<T> supplier) boolean
void
fromString
(String value) get()
int
hashCode()
boolean
boolean
boolean
isNull()
boolean
boolean
boolean
Compares this attribute to another attribute taking into account theAttributeDefinition.isGlobal()
flag.void
name()
protect()
void
void
removeListener
(Predicate<AttributeListener<T>> filter) void
removeListener
(AttributeListener<T> listener) void
reset()
void
void
setImplied
(T value) toString()
void
Updates this attribute with the value of the other attribute only if the attribute is mutable and the other has been modified from its default valuevoid
validate()
void
validateUpdate
(String parentName, Attribute<T> other) Verifies that updating the mutable part of this instance with the values of the other instance is possible
-
Method Details
-
name
-
get
-
orElse
-
getInitialValue
-
validate
public void validate() -
protect
-
set
-
setImplied
-
fromString
-
computeIfAbsent
-
isImmutable
public boolean isImmutable() -
isPersistent
public boolean isPersistent() -
isModified
public boolean isModified() -
isRepeated
public boolean isRepeated() -
addListener
-
removeListener
-
removeListener
-
isNull
public boolean isNull() -
getAttributeDefinition
-
clone
-
read
-
merge
-
hashCode
public int hashCode() -
equals
-
matches
Compares this attribute to another attribute taking into account theAttributeDefinition.isGlobal()
flag. If the attribute is global, then this method will return true only if the values are identical. If the attribute is local, then this method will return true even if the values don't match. Essentially, this method only ensures that the attribute definitions are equals. -
update
Updates this attribute with the value of the other attribute only if the attribute is mutable and the other has been modified from its default value -
validateUpdate
Description copied from interface:Updatable
Verifies that updating the mutable part of this instance with the values of the other instance is possible- Specified by:
validateUpdate
in interfaceUpdatable<T>
- Parameters:
other
-
-
apply
-
toString
-
reset
public void reset()
-