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 interfaceDirectionRelativeDataHolder.Immutable<I extends DirectionRelativeDataHolder.Immutable<I>>static interfaceDirectionRelativeDataHolder.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 OptionalDoublegetDouble(Direction direction, Key<? extends Value<Double>> key)default OptionalIntgetInt(Direction direction, Key<? extends Value<Integer>> key)default OptionalLonggetLong(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 aValuelinked to the providedKeyandDirection. If theKeyis not supported,Optional.empty()is returned. It is important to check for support of aKeyby 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 aValuelinked to the providedKeyandDirection. If theKeyis not supported,Optional.empty()is returned. It is important to check for support of aKeyby 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 aValuelinked to the providedKeyandDirection. If theKeyis not supported,Optional.empty()is returned. It is important to check for support of aKeyby 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 aValuelinked to the providedKeyandDirection. If theKeyis not supported,Optional.empty()is returned. It is important to check for support of aKeyby either callingValueContainer.supports(Value)orValueContainer.supports(Key).- Parameters:
direction- The directionkey- The key to retrieve the value for- Returns:
- The value, if available
-
-