Top Description Fields Constructors Methods
org.glassfish.grizzly.attributes

public Class DefaultAttributeBuilder

extends Object
implements AttributeBuilder
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.attributes.AttributeBuilder
Imports
java.util.ArrayList, .HashMap, .List, .Map, java.util.function.Supplier

Default AttributeBuilder implementation.
Author
Alexey Stashok
See Also
AttributeBuilder

Field Summary

Modifier and TypeField and Description
protected final List<Attribute<T>>
protected final Map<String, Attribute<T>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized <T> Attribute<T>
public synchronized <T> Attribute<T>
createAttribute(final String name, final T defaultValue)

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

Create Attribute with name and default value

public synchronized <T> Attribute<T>
createAttribute(final String name, final Supplier<T> initializer)

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute, org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

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

public AttributeHolder
public AttributeHolder
protected Attribute<T>
getAttributeByIndex(final int index)

protected Attribute<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesback to summary
protected final List<Attribute<T>> attributes
name2Attributeback to summary
protected final Map<String, Attribute<T>> name2Attribute

Constructor Detail

DefaultAttributeBuilderback to summary
public DefaultAttributeBuilder()

Method Detail

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

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

Create Attribute with name

Annotations
@Override
createAttributeback to summary
public synchronized <T> Attribute<T> createAttribute(final String name, final T defaultValue)

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

Create Attribute with name and default value

Annotations
@Override
@SuppressWarnings:unchecked
createAttributeback to summary
public synchronized <T> Attribute<T> createAttribute(final String name, final Supplier<T> initializer)

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute, org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

Doc from org.glassfish.grizzly.attributes.AttributeBuilder.createAttribute.

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

Annotations
@Override
@SuppressWarnings:unchecked
createSafeAttributeHolderback to summary
public AttributeHolder createSafeAttributeHolder()

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createSafeAttributeHolder.

Doc from org.glassfish.grizzly.attributes.AttributeBuilder.createSafeAttributeHolder.

Creates and returns new thread-safe AttributeHolder

Annotations
@Override
createUnsafeAttributeHolderback to summary
public AttributeHolder createUnsafeAttributeHolder()

Implements org.glassfish.grizzly.attributes.AttributeBuilder.createUnsafeAttributeHolder.

Doc from org.glassfish.grizzly.attributes.AttributeBuilder.createUnsafeAttributeHolder.

Creates and returns new non thread-safe AttributeHolder

Annotations
@Override
getAttributeByIndexback to summary
protected Attribute<T> getAttributeByIndex(final int index)
getAttributeByNameback to summary
protected Attribute<T> getAttributeByName(final String name)