Package org.glassfish.grizzly.attributes
Interface AttributeBuilder
-
- All Known Implementing Classes:
DefaultAttributeBuilder
public interface AttributeBuilderAttributeBuilder is responsible for creating and indexingAttributes. For faster access toAttributevalue, eachAttributehas assigned index. AttributeBuilder is responsible to assign eachAttributeunique index.- Author:
- Alexey Stashok
- See Also:
DefaultAttributeBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static AttributeBuilderDEFAULT_ATTRIBUTE_BUILDERThe defaultAttributeBuilderimplementation used by all created builder instances.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T> Attribute<T>createAttribute(String name)Create Attribute with name<T> Attribute<T>createAttribute(String name, NullaryFunction<T> initializer)Deprecated.pls.<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, T defaultValue)Create Attribute with name and default valueAttributeHoldercreateSafeAttributeHolder()Creates and returns new thread-safeAttributeHolderAttributeHoldercreateUnsafeAttributeHolder()Creates and returns new non thread-safeAttributeHolder
-
-
-
Field Detail
-
DEFAULT_ATTRIBUTE_BUILDER
static final AttributeBuilder DEFAULT_ATTRIBUTE_BUILDER
The default
AttributeBuilderimplementation used by all created builder instances.The default may be changed by setting the system property
org.glassfish.grizzly.DEFAULT_ATTRIBUTE_BUILDERwith 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.
-
-
Method Detail
-
createAttribute
<T> Attribute<T> createAttribute(String name)
Create Attribute with name- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute name- Returns:
- Attribute
-
createAttribute
<T> Attribute<T> createAttribute(String name, T defaultValue)
Create Attribute with name and default value- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute namedefaultValue- attribute's default value- Returns:
- Attribute
-
createAttribute
<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- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute nameinitializer- NullaryFunction, which will be called, if Attribute's value is null on a AttributedObject- Returns:
- Attribute
-
createAttribute
@Deprecated <T> Attribute<T> createAttribute(String name, NullaryFunction<T> initializer)
Deprecated.Create Attribute with name and initializer, which will be called, if Attribute's value is null on a AttributedObject- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute nameinitializer- NullaryFunction, which will be called, if Attribute's value is null on a AttributedObject- Returns:
- Attribute
-
createSafeAttributeHolder
AttributeHolder createSafeAttributeHolder()
Creates and returns new thread-safeAttributeHolder- Returns:
- thread-safe
AttributeHolder
-
createUnsafeAttributeHolder
AttributeHolder createUnsafeAttributeHolder()
Creates and returns new non thread-safeAttributeHolder- Returns:
- non thread-safe
AttributeHolder
-
-