Package org.patternfly.core
Interface ComponentContext<E extends Element,B extends TypedBuilder<E,B>>
- Type Parameters:
E
- the type of the element representing the componentB
- the type of the builder used to build the component
- All Superinterfaces:
IsElement<E>
,TypedBuilder<E,
B>
public interface ComponentContext<E extends Element,B extends TypedBuilder<E,B>>
extends TypedBuilder<E,B>, IsElement<E>
The ComponentContext interface represents a context for a component, providing methods to store and retrieve arbitrary values
associated with keys.
-
Method Summary
Modifier and TypeMethodDescription<T> T
Retrieves the value associated with the given key from the ComponentContext.default <T> T
Retrieves the value associated with the given key from the ComponentContext.default <T> T
Retrieves the value associated with the given key from the ComponentContext.boolean
Determines whether a value is stored with the specified key.<T> B
Stores a value associated with a key.Methods inherited from interface org.jboss.elemento.TypedBuilder
that
-
Method Details
-
store
Stores a value associated with a key.- Type Parameters:
T
- the type of the value being stored- Parameters:
key
- the key associated with the valuevalue
- the value to be stored
-
has
Determines whether a value is stored with the specified key.- Parameters:
key
- the key to check- Returns:
- true if a value is stored with the specified key, false otherwise
-
get
Retrieves the value associated with the given key from the ComponentContext.- Type Parameters:
T
- the type of the value being retrieved- Parameters:
key
- the key associated with the value- Returns:
- the value associated with the key, or null if no value is found
-
get
Retrieves the value associated with the given key from the ComponentContext.- Type Parameters:
T
- the type of the value being retrieved- Parameters:
key
- the key associated with the valuedefaultValue
- the default value to be returned if no value is found with the specified key- Returns:
- the value associated with the key, or the defaultValue if no value is found
-
get
Retrieves the value associated with the given key from the ComponentContext.- Type Parameters:
T
- the type of the value being retrieved- Parameters:
key
- the key associated with the valuedefaultValue
- the default value to be returned if no value is found with the specified key- Returns:
- the value associated with the key, or the defaultValue if no value is found
-