public interface VaadinContext extends Serializable
VaadinService
is running.
It is used to store service-scoped attributes.Modifier and Type | Method and Description |
---|---|
default <T> T |
getAttribute(Class<T> type)
Returns value of the specified attribute.
|
<T> T |
getAttribute(Class<T> type,
Supplier<T> defaultValueSupplier)
Returns value of the specified attribute, creating a default value if not
present.
|
void |
removeAttribute(Class<?> clazz)
Removes an attribute identified by the given type.
|
<T> void |
setAttribute(T value)
Sets the attribute value, overriding previously existing one.
|
<T> T getAttribute(Class<T> type, Supplier<T> defaultValueSupplier)
type
- Type of the attribute.defaultValueSupplier
- Supplier
of the default value, called when there is no
value already present. May be null
.default <T> T getAttribute(Class<T> type)
type
- Type of the attribute.<T> void setAttribute(T value)
value
- Value of the attribute. May not be null
.for removing attributes.
void removeAttribute(Class<?> clazz)
clazz
- Attribute type.for setting attributes.
Copyright © 2020. All rights reserved.