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 Optional<E>get(DataHolder dataHolder)Gets the elemental value from the providedDataHolder.Optional<E>get(DataHolder dataHolder, Direction direction)Gets the elemental value from the providedDataHolder.default booleanisSupported(DataHolder dataHolder)Gets whether this value provider is supported by the givenValueContainer.booleanisSupported(DataHolder dataHolder, Direction direction)Gets whether this value provider is supported by the givenValueContainer.default Optional<V>value(DataHolder dataHolder)Gets a constructedValuefor the providedDataHolder.default Optional<V>value(DataHolder dataHolder, Direction direction)Gets a constructedValuefor 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 Optional<E> get(DataHolder dataHolder)
Description copied from interface:DataProviderGets the elemental value from the providedDataHolder. This is generally considered the underlying implementation access for anyValueContainer.get(Key)where theKeyis 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 Optional<V> value(DataHolder dataHolder)
Description copied from interface:DataProviderGets a constructedValuefor the providedDataHolder. Much likeDataProvider.get(DataHolder), this is generally considered the underlying implementation access for anyValueContainer.get(Key)where theKeyis 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:DataProviderGets whether this value provider is supported by the givenValueContainer.- Specified by:
isSupportedin interfaceDataProvider<V extends Value<E>,E>- Parameters:
dataHolder- The data holder- Returns:
- Whether it's supported
-
get
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 theKeyis 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 Optional<V> value(DataHolder dataHolder, Direction direction)
Gets a constructedValuefor the providedDataHolder. Much likeget(DataHolder), this is generally considered the underlying implementation access for anyValueContainer.get(Key)where theKeyis 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
-
-