Package org.spongepowered.api.data
Interface DirectionRelativeDataHolder
-
- All Superinterfaces:
DataHolder
,ValueContainer
- All Known Subinterfaces:
BlockState
,DirectionRelativeDataHolder.Immutable<I>
,DirectionRelativeDataHolder.Mutable
,ServerLocation
public interface DirectionRelativeDataHolder extends DataHolder
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
DirectionRelativeDataHolder.Immutable<I extends DirectionRelativeDataHolder.Immutable<I>>
static interface
DirectionRelativeDataHolder.Mutable
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <E> Optional<E>
get(Direction direction, Key<? extends Value<E>> key)
default OptionalDouble
getDouble(Direction direction, Key<? extends Value<Double>> key)
default OptionalInt
getInt(Direction direction, Key<? extends Value<Integer>> key)
default OptionalLong
getLong(Direction direction, Key<? extends Value<Long>> key)
-
-
-
Method Detail
-
get
<E> Optional<E> get(Direction direction, Key<? extends Value<E>> key)
Attempts to get the underlying value backed by aValue
linked to the providedKey
andDirection
. If theKey
is not supported,Optional.empty()
is returned. It is important to check for support of aKey
by either callingValueContainer.supports(Value)
orValueContainer.supports(Key)
.- Type Parameters:
E
- The type of value- Parameters:
direction
- The directionkey
- The key to retrieve the value for- Returns:
- The value, if available
-
getInt
default OptionalInt getInt(Direction direction, Key<? extends Value<Integer>> key)
Attempts to get the underlying int value backed by aValue
linked to the providedKey
andDirection
. If theKey
is not supported,Optional.empty()
is returned. It is important to check for support of aKey
by either callingValueContainer.supports(Value)
orValueContainer.supports(Key)
.- Parameters:
direction
- The directionkey
- The key to retrieve the value for- Returns:
- The value, if available
-
getDouble
default OptionalDouble getDouble(Direction direction, Key<? extends Value<Double>> key)
Attempts to get the underlying double value backed by aValue
linked to the providedKey
andDirection
. If theKey
is not supported,Optional.empty()
is returned. It is important to check for support of aKey
by either callingValueContainer.supports(Value)
orValueContainer.supports(Key)
.- Parameters:
direction
- The directionkey
- The key to retrieve the value for- Returns:
- The value, if available
-
getLong
default OptionalLong getLong(Direction direction, Key<? extends Value<Long>> key)
Attempts to get the underlying long value backed by aValue
linked to the providedKey
andDirection
. If theKey
is not supported,Optional.empty()
is returned. It is important to check for support of aKey
by either callingValueContainer.supports(Value)
orValueContainer.supports(Key)
.- Parameters:
direction
- The directionkey
- The key to retrieve the value for- Returns:
- The value, if available
-
-