Package org.spongepowered.api.data
Interface DataHolder.Immutable<I extends DataHolder.Immutable<I>>
- 
- All Superinterfaces:
- DataHolder,- ValueContainer
 - All Known Subinterfaces:
- BlockSnapshot,- BlockState,- BlockType,- DirectionRelativeDataHolder.Immutable<I>,- EntitySnapshot,- FluidStackSnapshot,- FluidState,- FluidType,- ItemStackSnapshot,- ItemType,- LocatableBlock,- LocatableSnapshot<T>,- SerializableDataHolder.Immutable<I>,- State<S>
 - Enclosing interface:
- DataHolder
 
 public static interface DataHolder.Immutable<I extends DataHolder.Immutable<I>> extends DataHolder Represents aDataHolderthat is immutable and can be transformed into other immutable data holders.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolderDataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ImergeWith(I that)Attempts to merge theValue.Immutables from thisDataHolder.Immutableand the givenDataHolder.Immutableto produce a new instance of the merged result.ImergeWith(I that, MergeFunction function)Attempts to merge theValue.Immutables from thisDataHolder.Immutableand the givenDataHolder.Immutableto produce a new instance of the merged result.default <E> java.util.Optional<I>transform(java.util.function.Supplier<? extends Key<? extends Value<E>>> key, java.util.function.Function<E,E> function)Applies a transformation on the providedValuesuch that the return value ofFunction.apply(Object)will become the end resulting value set into the newly createdDataHolder.Immutable.<E> java.util.Optional<I>transform(Key<? extends Value<E>> key, java.util.function.Function<E,E> function)Applies a transformation on the providedValuesuch that the return value ofFunction.apply(Object)will become the end resulting value set into the newly createdDataHolder.Immutable.default <E> java.util.Optional<I>with(java.util.function.Supplier<? extends Key<? extends Value<E>>> key, E value)Creates a newDataHolder.Immutablewith the provided value byKey.<E> java.util.Optional<I>with(Key<? extends Value<E>> key, E value)Creates a newDataHolder.Immutablewith the provided value byKey.java.util.Optional<I>with(Value<?> value)Offers the givenvalueas defined by the providedKeysuch that if theKeyis supported, a newDataHolder.Immutableis created.default java.util.Optional<I>without(java.util.function.Supplier<? extends Key<?>> key)Creates a newDataHolder.Immutablewithout the providedKey.java.util.Optional<I>without(Key<?> key)Creates a newDataHolder.Immutablewithout the providedKey.default java.util.Optional<I>without(Value<?> value)Creates a newDataHolder.Immutablewithout the key of the providedValue.
 
- 
- 
- 
Method Detail- 
transform<E> java.util.Optional<I> transform(Key<? extends Value<E>> key, java.util.function.Function<E,E> function) Applies a transformation on the providedValuesuch that the return value ofFunction.apply(Object)will become the end resulting value set into the newly createdDataHolder.Immutable.- Type Parameters:
- E- The type of value
- Parameters:
- key- The key linked to
- function- The function to manipulate the value
- Returns:
- The newly created immutable value store
 
 - 
transformdefault <E> java.util.Optional<I> transform(java.util.function.Supplier<? extends Key<? extends Value<E>>> key, java.util.function.Function<E,E> function) Applies a transformation on the providedValuesuch that the return value ofFunction.apply(Object)will become the end resulting value set into the newly createdDataHolder.Immutable.- Type Parameters:
- E- The type of value
- Parameters:
- key- The key linked to
- function- The function to manipulate the value
- Returns:
- The newly created immutable value store
 
 - 
with<E> java.util.Optional<I> with(Key<? extends Value<E>> key, E value) Creates a newDataHolder.Immutablewith the provided value byKey. If the key is supported by this value store, the returned value store will be present.- Type Parameters:
- E- The type of value
- Parameters:
- key- The key to the value to set
- value- The value to set
- Returns:
- The new immutable value store
 
 - 
withdefault <E> java.util.Optional<I> with(java.util.function.Supplier<? extends Key<? extends Value<E>>> key, E value) Creates a newDataHolder.Immutablewith the provided value byKey. If the key is supported by this value store, the returned value store will be present.- Type Parameters:
- E- The type of value
- Parameters:
- key- The key to the value to set
- value- The value to set
- Returns:
- The new immutable value store
 
 - 
withjava.util.Optional<I> with(Value<?> value) Offers the givenvalueas defined by the providedKeysuch that if theKeyis supported, a newDataHolder.Immutableis created.- Parameters:
- value- The value to set
- Returns:
- The new immutable value store
 
 - 
withoutdefault java.util.Optional<I> without(Value<?> value) Creates a newDataHolder.Immutablewithout the key of the providedValue. If the key is supported by this value store, the returned value store will be present.- Parameters:
- value- The value
- Returns:
- The new immutable value store
 
 - 
withoutjava.util.Optional<I> without(Key<?> key) Creates a newDataHolder.Immutablewithout the providedKey. If the key is supported by this value store, the returned value store will be present.- Parameters:
- key- The key to remove
- Returns:
- The new immutable value store
 
 - 
withoutdefault java.util.Optional<I> without(java.util.function.Supplier<? extends Key<?>> key) Creates a newDataHolder.Immutablewithout the providedKey. If the key is supported by this value store, the returned value store will be present.- Parameters:
- key- The key to remove
- Returns:
- The new immutable value store
 
 - 
mergeWithdefault I mergeWith(I that) Attempts to merge theValue.Immutables from thisDataHolder.Immutableand the givenDataHolder.Immutableto produce a new instance of the merged result.- Parameters:
- that- The other immutable value store to gather values from
- Returns:
- The new immutable value store instance
 
 - 
mergeWithI mergeWith(I that, MergeFunction function) Attempts to merge theValue.Immutables from thisDataHolder.Immutableand the givenDataHolder.Immutableto produce a new instance of the merged result. Any overlappingValueContainers are merged through theMergeFunction.- Parameters:
- that- The other immutable value store to gather values from
- function- The function to resolve merge conflicts
- Returns:
- The new immutable value store instance
 
 
- 
 
-