public interface AttributeBuilder
Attributes.
For faster access to Attribute value, each Attribute has
assigned index. AttributeBuilder is responsible to assign each
Attribute unique index.DefaultAttributeBuilder| Modifier and Type | Field and Description |
|---|---|
static AttributeBuilder |
DEFAULT_ATTRIBUTE_BUILDER
The default
AttributeBuilder implementation used by all created builder
instances. |
| Modifier and Type | Method and Description |
|---|---|
<T> Attribute<T> |
createAttribute(String name)
Create Attribute with name
|
<T> Attribute<T> |
createAttribute(String name,
NullaryFunction<T> initializer)
Create Attribute with name and initializer, which will be called, if
Attribute's value is null on a AttributedObject
|
<T> Attribute<T> |
createAttribute(String name,
NullaryFunction<T> initializer)
Deprecated.
|
<T> Attribute<T> |
createAttribute(String name,
T defaultValue)
Create Attribute with name and default value
|
AttributeHolder |
createSafeAttributeHolder()
Creates and returns new thread-safe
AttributeHolder |
AttributeHolder |
createUnsafeAttributeHolder()
Creates and returns new non thread-safe
AttributeHolder |
static final AttributeBuilder DEFAULT_ATTRIBUTE_BUILDER
The default AttributeBuilder implementation used by all created builder
instances.
The default may be changed by setting the system property org.glassfish.grizzly.DEFAULT_ATTRIBUTE_BUILDER
with the fully qualified name of the class that implements the AttributeBuilder interface. Note that this class must
be public and have a public no-arg constructor.
<T> Attribute<T> createAttribute(String name)
T - Type of attribute valuename - attribute name<T> Attribute<T> createAttribute(String name, T defaultValue)
T - Type of attribute valuename - attribute namedefaultValue - attribute's default value<T> Attribute<T> createAttribute(String name, NullaryFunction<T> initializer)
T - Type of attribute valuename - attribute nameinitializer - NullaryFunction, which will be called, if Attribute's
value is null on a AttributedObject<T> Attribute<T> createAttribute(String name, NullaryFunction<T> initializer)
createAttribute(java.lang.String, org.glassfish.grizzly.utils.NullaryFunction).T - Type of attribute valuename - attribute nameinitializer - NullaryFunction, which will be called, if Attribute's
value is null on a AttributedObjectAttributeHolder createSafeAttributeHolder()
AttributeHolderAttributeHolderAttributeHolder createUnsafeAttributeHolder()
AttributeHolderAttributeHolderCopyright © 2014 Oracle Corporation. All Rights Reserved.