Package org.spongepowered.api.data
Interface DirectionRelativeDataProvider<V extends Value<E>,E>
-
- All Superinterfaces:
DataProvider<V,E>
public interface DirectionRelativeDataProvider<V extends Value<E>,E> extends DataProvider<V,E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Optional<E>
get(DataHolder dataHolder)
Gets the elemental value from the providedDataHolder
.java.util.Optional<E>
get(DataHolder dataHolder, Direction direction)
Gets the elemental value from the providedDataHolder
.default boolean
isSupported(DataHolder dataHolder)
Gets whether this value provider is supported by the givenValueContainer
.boolean
isSupported(DataHolder dataHolder, Direction direction)
Gets whether this value provider is supported by the givenValueContainer
.default java.util.Optional<V>
value(DataHolder dataHolder)
Gets a constructedValue
for the providedDataHolder
.default java.util.Optional<V>
value(DataHolder dataHolder, Direction direction)
Gets a constructedValue
for the providedDataHolder
.-
Methods inherited from interface org.spongepowered.api.data.DataProvider
allowsAsynchronousAccess, isSupported, isSupported, key, offer, offerValue, remove, with, without, withValue
-
-
-
-
Method Detail
-
get
default java.util.Optional<E> get(DataHolder dataHolder)
Description copied from interface:DataProvider
Gets the elemental value from the providedDataHolder
. This is generally considered the underlying implementation access for anyValueContainer.get(Key)
where theKey
is registered with thisDataProvider
. Nominally, this means the data is provided outside traditional serialized data that is stored with theDataHolder
. It's possible that there may be changing return values for even immutable types, since the provider is providing the data.
-
value
default java.util.Optional<V> value(DataHolder dataHolder)
Description copied from interface:DataProvider
Gets a constructedValue
for the providedDataHolder
. Much likeDataProvider.get(DataHolder)
, this is generally considered the underlying implementation access for anyValueContainer.get(Key)
where theKey
is registered with thisDataProvider
. Nominally, this means the data is provided outside traditional serialized data that is stored with theDataHolder
. It's possible that there may be changing return values for even immutable types, since the provider is providing the data.
-
isSupported
default boolean isSupported(DataHolder dataHolder)
Description copied from interface:DataProvider
Gets whether this value provider is supported by the givenValueContainer
.- Specified by:
isSupported
in interfaceDataProvider<V extends Value<E>,E>
- Parameters:
dataHolder
- The data holder- Returns:
- Whether it's supported
-
get
java.util.Optional<E> get(DataHolder dataHolder, Direction direction)
Gets the elemental value from the providedDataHolder
. This is generally considered the underlying implementation access for anyValueContainer.get(Key)
where theKey
is registered with thisDataProvider
. Nominally, this means the data is provided outside traditional serialized data that is stored with theDataHolder
. It's possible that there may be changing return values for even immutable types, since the provider is providing the data.- Parameters:
dataHolder
- The data holderdirection
- The related relative direction to the data provider- Returns:
- The value, if it's supported and exists
-
value
default java.util.Optional<V> value(DataHolder dataHolder, Direction direction)
Gets a constructedValue
for the providedDataHolder
. Much likeget(DataHolder)
, this is generally considered the underlying implementation access for anyValueContainer.get(Key)
where theKey
is registered with thisDataProvider
. Nominally, this means the data is provided outside traditional serialized data that is stored with theDataHolder
. It's possible that there may be changing return values for even immutable types, since the provider is providing the data.- Parameters:
dataHolder
- The data holder to get the constructed value fromdirection
- The related relative direction to the data provider- Returns:
- The value
-
isSupported
boolean isSupported(DataHolder dataHolder, Direction direction)
Gets whether this value provider is supported by the givenValueContainer
.- Parameters:
dataHolder
- The data holderdirection
- The related relative direction to the data provider- Returns:
- Whether it's supported
-
-