org.glassfish.grizzly.attributes
Class DefaultAttributeBuilder
java.lang.Object
org.glassfish.grizzly.attributes.DefaultAttributeBuilder
- All Implemented Interfaces:
- AttributeBuilder
public class DefaultAttributeBuilder
- extends java.lang.Object
- implements AttributeBuilder
Default AttributeBuilder implementation.
- Author:
- Alexey Stashok
- See Also:
AttributeBuilder
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
attributes
protected final java.util.List<Attribute> attributes
name2Attribute
protected final java.util.Map<java.lang.String,Attribute> name2Attribute
DefaultAttributeBuilder
public DefaultAttributeBuilder()
createAttribute
public <T> Attribute<T> createAttribute(java.lang.String name)
- Create Attribute with name
- Specified by:
createAttribute in interface AttributeBuilder
- Type Parameters:
T - Type of attribute value- Parameters:
name - attribute name
- Returns:
- Attribute
createAttribute
public <T> Attribute<T> createAttribute(java.lang.String name,
T defaultValue)
- Create Attribute with name and default value
- Specified by:
createAttribute in interface AttributeBuilder
- Type Parameters:
T - Type of attribute value- Parameters:
name - attribute namedefaultValue - attribute's default value
- Returns:
- Attribute
createAttribute
public <T> Attribute<T> createAttribute(java.lang.String name,
NullaryFunction<T> initializer)
- Create Attribute with name and initializer, which will be called, if
Attribute's value is null on a AttributedObject
- Specified by:
createAttribute in interface AttributeBuilder
- 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
getAttributeByName
protected Attribute getAttributeByName(java.lang.String name)
getAttributeByIndex
protected Attribute getAttributeByIndex(int index)
Copyright © 2011 Oracle Corpration. All Rights Reserved.