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> java.util.Optional<E>
get(Direction direction, Key<? extends Value<E>> key)
default java.util.OptionalDouble
getDouble(Direction direction, Key<? extends Value<java.lang.Double>> key)
default java.util.OptionalInt
getInt(Direction direction, Key<? extends Value<java.lang.Integer>> key)
default java.util.OptionalLong
getLong(Direction direction, Key<? extends Value<java.lang.Long>> key)
-
-
-
Method Detail
-
get
<E> java.util.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 java.util.OptionalInt getInt(Direction direction, Key<? extends Value<java.lang.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 java.util.OptionalDouble getDouble(Direction direction, Key<? extends Value<java.lang.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 java.util.OptionalLong getLong(Direction direction, Key<? extends Value<java.lang.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
-
-