java.lang.Object
org.glassfish.grizzly.attributes.DefaultAttributeBuilder
- All Implemented Interfaces:
AttributeBuilder
Default
AttributeBuilder implementation.- Author:
- Alexey Stashok
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface org.glassfish.grizzly.attributes.AttributeBuilder
DEFAULT_ATTRIBUTE_BUILDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Attribute<T>createAttribute(String name) Create Attribute with name<T> Attribute<T>createAttribute(String name, Supplier<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 valueCreates and returns new thread-safeAttributeHolderCreates and returns new non thread-safeAttributeHolderprotected AttributegetAttributeByIndex(int index) protected AttributegetAttributeByName(String name)
-
Field Details
-
attributes
-
name2Attribute
-
-
Constructor Details
-
DefaultAttributeBuilder
public DefaultAttributeBuilder()
-
-
Method Details
-
createAttribute
Create Attribute with name- Specified by:
createAttributein interfaceAttributeBuilder- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute name- Returns:
- Attribute
-
createAttribute
Create Attribute with name and default value- Specified by:
createAttributein interfaceAttributeBuilder- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute namedefaultValue- attribute's default value- Returns:
- Attribute
-
createAttribute
Create Attribute with name and initializer, which will be called, if Attribute's value is null on a AttributedObject- Specified by:
createAttributein interfaceAttributeBuilder- Type Parameters:
T- Type of attribute value- Parameters:
name- attribute nameinitializer-Supplier, which will be called, if Attribute's value is null on a AttributedObject- Returns:
- Attribute
-
createSafeAttributeHolder
Description copied from interface:AttributeBuilderCreates and returns new thread-safeAttributeHolder- Specified by:
createSafeAttributeHolderin interfaceAttributeBuilder- Returns:
- thread-safe
AttributeHolder
-
createUnsafeAttributeHolder
Description copied from interface:AttributeBuilderCreates and returns new non thread-safeAttributeHolder- Specified by:
createUnsafeAttributeHolderin interfaceAttributeBuilder- Returns:
- non thread-safe
AttributeHolder
-
getAttributeByName
-
getAttributeByIndex
-