Package org.spongepowered.api.data
Interface DirectionRelativeDataHolder
- All Superinterfaces:
DataHolder
,ValueContainer
- All Known Subinterfaces:
BlockState
,DirectionRelativeDataHolder.Immutable<I>
,DirectionRelativeDataHolder.Mutable
,ServerLocation
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
-
Method Summary
Modifier and TypeMethodDescription<E> Optional<E>
default OptionalDouble
default OptionalInt
default OptionalLong
-
Method Details
-
get
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
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
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
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
-