Package org.spongepowered.plugin.builtin
Class StandardBlackboard
- java.lang.Object
-
- org.spongepowered.plugin.builtin.StandardBlackboard
-
- All Implemented Interfaces:
Blackboard
public final class StandardBlackboard extends Object implements Blackboard
-
-
Constructor Summary
Constructors Constructor Description StandardBlackboard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> Optional<V>
find(Key<V> key)
<V> V
get(Key<V> key)
<V> V
getOrCreate(Key<V> key, Supplier<? super V> defaultValue)
Retrieves a value bykey
or from thedefault value
.
-
-
-
Method Detail
-
getOrCreate
public <V> V getOrCreate(Key<V> key, Supplier<? super V> defaultValue)
Description copied from interface:Blackboard
Retrieves a value bykey
or from thedefault value
.- Specified by:
getOrCreate
in interfaceBlackboard
- Type Parameters:
V
- The value type- Parameters:
key
- The keydefaultValue
- The default value- Returns:
- The value
-
get
public <V> V get(Key<V> key)
- Specified by:
get
in interfaceBlackboard
- Type Parameters:
V
- The value type- Parameters:
key
- The key- Returns:
- The value
-
find
public <V> Optional<V> find(Key<V> key)
- Specified by:
find
in interfaceBlackboard
- Type Parameters:
V
- The value type- Parameters:
key
- The key- Returns:
- The value or
Optional.empty()
otherwise
-
-