public static class Attributes.DefaultImpls
Map of attributes accessible by class AttributeKey in a typed manner
class AttributeKey| Modifier and Type | Method and Description |
|---|---|
static <T> T |
get(Attributes $this,
AttributeKey<T> key)
Gets a value of the attribute for the specified key, or throws an exception if an attribute doesn't exist
|
static <T> T |
take(Attributes $this,
AttributeKey<T> key)
Removes an attribute with the specified key and returns its current value, throws an exception if an attribute doesn't exist
|
static <T> T |
takeOrNull(Attributes $this,
AttributeKey<T> key)
Removes an attribute with the specified key and returns its current value, returns
null if an attribute doesn't exist |
public static <T> T get(Attributes $this, AttributeKey<T> key)
Gets a value of the attribute for the specified key, or throws an exception if an attribute doesn't exist
public static <T> T take(Attributes $this, AttributeKey<T> key)
Removes an attribute with the specified key and returns its current value, throws an exception if an attribute doesn't exist
public static <T> T takeOrNull(Attributes $this, AttributeKey<T> key)
Removes an attribute with the specified key and returns its current value, returns null if an attribute doesn't exist