Top Description Fields Methods
org.glassfish.grizzly.attributes

public Interface AttributeBuilder

Known Direct Implementers
org.glassfish.grizzly.attributes.DefaultAttributeBuilder
Imports
java.util.function.Supplier

AttributeBuilder is responsible for creating and indexing Attributes. For faster access to Attribute value, each Attribute has assigned index. AttributeBuilder is responsible to assign each Attribute unique index.
Author
Alexey Stashok
See Also
DefaultAttributeBuilder

Field Summary

Modifier and TypeField and Description
public static final AttributeBuilder
DEFAULT_ATTRIBUTE_BUILDER

The default AttributeBuilder implementation used by all created builder instances.

Method Summary

Modifier and TypeMethod and Description
public <
Type of attribute value
T
>
Attribute<T>

Returns:

Attribute
createAttribute
(String
attribute name
name
)

Create Attribute with name

public <
Type of attribute value
T
>
Attribute<T>

Returns:

Attribute
createAttribute
(String
attribute name
name
,
T
attribute's default value
defaultValue
)

Create Attribute with name and default value

public <
Type of attribute value
T
>
Attribute<T>

Returns:

Attribute
createAttribute
(String
attribute name
name
,
Supplier<T>
Supplier, which will be called, if Attribute's value is null on a AttributedObject
initializer
)

Create Attribute with name and initializer, which will be called, if Attribute's value is null on a AttributedObject

public AttributeHolder

Returns:

thread-safe AttributeHolder
createSafeAttributeHolder
()

Creates and returns new thread-safe AttributeHolder

public AttributeHolder

Returns:

non thread-safe AttributeHolder
createUnsafeAttributeHolder
()

Creates and returns new non thread-safe AttributeHolder

Field Detail

DEFAULT_ATTRIBUTE_BUILDERback to summary
public 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.

Method Detail

createAttributeback to summary
public <T> Attribute<T> createAttribute(String name)

Create Attribute with name

Parameters
<T>
Type of attribute value
name:String

attribute name

Returns:Attribute<T>

Attribute

createAttributeback to summary
public <T> Attribute<T> createAttribute(String name, T defaultValue)

Create Attribute with name and default value

Parameters
<T>
Type of attribute value
name:String

attribute name

defaultValue:T

attribute's default value

Returns:Attribute<T>

Attribute

createAttributeback to summary
public <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

Parameters
<T>
Type of attribute value
name:String

attribute name

initializer:Supplier<T>

Supplier, which will be called, if Attribute's value is null on a AttributedObject

Returns:Attribute<T>

Attribute

createSafeAttributeHolderback to summary
public AttributeHolder createSafeAttributeHolder()

Creates and returns new thread-safe AttributeHolder

Returns:AttributeHolder

thread-safe AttributeHolder

createUnsafeAttributeHolderback to summary
public AttributeHolder createUnsafeAttributeHolder()

Creates and returns new non thread-safe AttributeHolder

Returns:AttributeHolder

non thread-safe AttributeHolder