Class AttributeDefinition<T>
- java.lang.Object
-
- org.infinispan.commons.configuration.attributes.AttributeDefinition<T>
-
public final class AttributeDefinition<T> extends Object
AttributeDefinition. Defines the characteristics of a configuration attribute. It is used to construct an actualAttribute
holder. An attribute definition has the following characteristics:- A name
- A default value or a value initializer
- A type, which needs to be specified if it cannot be inferred from the default value, i.e. when it is null
- Whether an attribute is immutable or not, i.e. whether its value is constant after initialization or it can be changed
- A validator which intercepts invalid values
- Since:
- 7.2
- Author:
- Tristan Tarrant
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeDefinition.Builder<T>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> AttributeDefinition.Builder<T>
builder(String name, T defaultValue)
static <T> AttributeDefinition.Builder<T>
builder(String name, T defaultValue, Class<T> klass)
static <T> AttributeDefinition.Builder<Class<? extends T>>
classBuilder(String name, Class<T> klass)
AttributeCopier
copier()
boolean
equals(Object o)
T
getDefaultValue()
Class<T>
getType()
int
hashCode()
AttributeInitializer<? extends T>
initializer()
boolean
isAutoPersist()
boolean
isGlobal()
boolean
isImmutable()
String
name()
static <T> AttributeDefinition.Builder<Supplier<? extends T>>
supplierBuilder(String name, Class<T> klass)
Attribute<T>
toAttribute()
void
validate(T value)
String
xmlName()
-
-
-
Method Detail
-
name
public String name()
-
xmlName
public String xmlName()
-
getDefaultValue
public T getDefaultValue()
-
isImmutable
public boolean isImmutable()
-
isAutoPersist
public boolean isAutoPersist()
-
isGlobal
public boolean isGlobal()
-
copier
public AttributeCopier copier()
-
initializer
public AttributeInitializer<? extends T> initializer()
-
validate
public void validate(T value)
-
builder
public static <T> AttributeDefinition.Builder<T> builder(String name, T defaultValue)
-
builder
public static <T> AttributeDefinition.Builder<T> builder(String name, T defaultValue, Class<T> klass)
-
classBuilder
public static <T> AttributeDefinition.Builder<Class<? extends T>> classBuilder(String name, Class<T> klass)
-
supplierBuilder
public static <T> AttributeDefinition.Builder<Supplier<? extends T>> supplierBuilder(String name, Class<T> klass)
-
-