Top Description Methods
org.glassfish.grizzly.attributes

public Interface AttributeHolder

Known Direct Implementers
org.glassfish.grizzly.attributes.IndexedAttributeHolder, org.glassfish.grizzly.attributes.IndexedMapAttributeHolder, org.glassfish.grizzly.attributes.UnsafeAttributeHolder
Imports
java.util.Set, java.util.function.Supplier

Interface declares common functionality for objects, which have associated Attributes.
Author
Alexey Stashok
See Also
IndexedAttributeHolder, NamedAttributeHolder

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clear all the attributes.

public void
copyFrom(AttributeHolder srcAttributes)

Copies attributes from the srcAttributes to this AttributeHolder

public void
copyTo(AttributeHolder dstAttributes)

Copies attributes from this AttributeHolder to the dstAttributes.

public Object

Returns:

- attribute value for the name, null if name does not exist in attributes
getAttribute
(String
- name of an attribute
name
)

Return an object based on a name.

public Object

Returns:

- attribute value for the name, null if name does not exist in attributes
getAttribute
(String
- name of an attribute
name
,
Supplier<T>
the initializer to be used to assign a default attribute value, in case it hasn't been assigned
initializer
)

Return an object based on a name.

public AttributeBuilder

Returns:

AttributeBuilder
getAttributeBuilder
()

Get AttributeBuilder, associated with this holder

public Set<String>

Returns:

- Set of attribute names
getAttributeNames
()

Return a Set of attribute names.

public IndexedAttributeAccessor
getIndexedAttributeAccessor()

If AttributeHolder supports attribute access by index - it will return an IndexedAttributeAccessor, which will make Attribute access as fast as access to array element.

public void
recycle()

Recycle AttributeHolder

public Object

Returns:

attribute which has been removed
removeAttribute
(String
- name of an attribute
name
)

Remove a name/value object.

public void
setAttribute(String
- name of an attribute
name
,
Object
- value of named attribute
value
)

Set a name/value object.

Method Detail

clearback to summary
public void clear()

Clear all the attributes.

copyFromback to summary
public void copyFrom(AttributeHolder srcAttributes)

Copies attributes from the srcAttributes to this AttributeHolder

copyToback to summary
public void copyTo(AttributeHolder dstAttributes)

Copies attributes from this AttributeHolder to the dstAttributes.

getAttributeback to summary
public Object getAttribute(String name)

Return an object based on a name.

Parameters
name:String

- name of an attribute

Returns:Object

- attribute value for the name, null if name does not exist in attributes

getAttributeback to summary
public Object getAttribute(String name, Supplier<T> initializer)

Return an object based on a name.

Parameters
name:String

- name of an attribute

initializer:Supplier<T>

the initializer to be used to assign a default attribute value, in case it hasn't been assigned

Returns:Object

- attribute value for the name, null if name does not exist in attributes

Since
2.3.18
getAttributeBuilderback to summary
public AttributeBuilder getAttributeBuilder()

Get AttributeBuilder, associated with this holder

Returns:AttributeBuilder

AttributeBuilder

getAttributeNamesback to summary
public Set<String> getAttributeNames()

Return a Set of attribute names.

Returns:Set<String>

- Set of attribute names

getIndexedAttributeAccessorback to summary
public IndexedAttributeAccessor getIndexedAttributeAccessor()

If AttributeHolder supports attribute access by index - it will return an IndexedAttributeAccessor, which will make Attribute access as fast as access to array element.

Returns:IndexedAttributeAccessor

IndexedAttributeAccessor.

recycleback to summary
public void recycle()

Recycle AttributeHolder

removeAttributeback to summary
public Object removeAttribute(String name)

Remove a name/value object.

Parameters
name:String

- name of an attribute

Returns:Object

attribute which has been removed

setAttributeback to summary
public void setAttribute(String name, Object value)

Set a name/value object.

Parameters
name:String

- name of an attribute

value:Object

- value of named attribute