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> Vget(Key<V> key)<V> VgetOrCreate(Key<V> key, Supplier<? super V> defaultValue)Retrieves a value bykeyor from thedefault value.
-
-
-
Method Detail
-
getOrCreate
public <V> V getOrCreate(Key<V> key, Supplier<? super V> defaultValue)
Description copied from interface:BlackboardRetrieves a value bykeyor from thedefault value.- Specified by:
getOrCreatein 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:
getin 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:
findin interfaceBlackboard- Type Parameters:
V- The value type- Parameters:
key- The key- Returns:
- The value or
Optional.empty()otherwise
-
-