Top Description Methods
org.glassfish.grizzly.attributes

public Interface IndexedAttributeAccessor

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

The interface declares, that AttributeHolder supports indexed Attribute access.
See Also
AttributeHolder

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the value of the attribute by index
getAttribute
(int
the attribute index
index
)

Internal method for dynamic attribute support.

public Object

Returns:

the value of the attribute by index
getAttribute
(int
the attribute index
index
,
Supplier<T>
the default value Supplier
initializer
)

Internal method for dynamic attribute support.

public Object

Returns:

the previous value associated with the attribute
removeAttribute
(int
the attribute index
index
)

Internal method for dynamic attribute support.

public void
setAttribute(int
the attribute index
index
,
Object
the value
value
)

Internal method for dynamic attribute support.

Method Detail

getAttributeback to summary
public Object getAttribute(int index)

Internal method for dynamic attribute support. Return the value of the attribute by index.

Parameters
index:int

the attribute index

Returns:Object

the value of the attribute by index

getAttributeback to summary
public Object getAttribute(int index, Supplier<T> initializer)

Internal method for dynamic attribute support. Return the value of the attribute by index. If the attribute with such index is not set, set it to the default value, using the initializer, and return the default.

Parameters
index:int

the attribute index

initializer:Supplier<T>

the default value Supplier

Returns:Object

the value of the attribute by index

Since
2.3.18
removeAttributeback to summary
public Object removeAttribute(int index)

Internal method for dynamic attribute support. Removes the attribute with the index and returns its previous value.

Parameters
index:int

the attribute index

Returns:Object

the previous value associated with the attribute

Since
2.3.18
setAttributeback to summary
public void setAttribute(int index, Object value)

Internal method for dynamic attribute support. Set the attribute with the index to value.

Parameters
index:int

the attribute index

value:Object

the value