Interface DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>
- Type Parameters:
S- the type that implements this interface, for chainable method return types.
- All Superinterfaces:
DefaultedDocPropertyHolder,DocPropertyHolder,DocPropertyHolder.Mutable<S>
- All Known Subinterfaces:
DefaultedDocPropertyHolder.Mutable.WithDirectModifier<S>
- All Known Implementing Classes:
GroupConfiguration.Builder,ServiceConfiguration.Builder,ServiceConfigurationBase.Builder,ServiceTask.Builder
- Enclosing interface:
DefaultedDocPropertyHolder
public static interface DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>
extends DefaultedDocPropertyHolder, DocPropertyHolder.Mutable<S>
An implementation of a mutable doc property holder that defaults all method calls to the underlying document that
is returned by the
DocPropertyHolder.propertyHolder() method.- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA subclass of a mutable doc property holder which allows to modify the underlying property document of this holder easily.Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DocPropertyHolder
DocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>> -
Method Summary
Modifier and TypeMethodDescriptiondefault <E> EremoveProperty(@NonNull DocProperty<E> property) Removes the given doc property from the underlying document.default <E> SwriteProperty(@NonNull DocProperty<E> property, E value) Writes the given property and value into the underlying document.default <E> SwritePropertyIfAbsent(@NonNull DocProperty<E> property, E value) Writes the given property and value into the underlying document if no other value is associated yet with the given property.default <E> SwritePropertyIfAbsent(@NonNull DocProperty<E> property, @NonNull Supplier<? extends E> valueSupplier) Writes the given property and computed value into the underlying document if no other value is associated yet with the given property.default <E> SwritePropertyIfPresent(@NonNull DocProperty<E> property, E val) Writes the given property and value into the underlying document if another value is already associated with the given property.default <E> SwritePropertyIfPresent(@NonNull DocProperty<E> property, @NonNull Supplier<? extends E> valueSupplier) Writes the given property and computed value into the underlying document if another value is already associated with the given property.Methods inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrowMethods inherited from interface eu.cloudnetservice.driver.document.property.DocPropertyHolder.Mutable
propertyHolder
-
Method Details
-
writeProperty
Writes the given property and value into the underlying document.- Specified by:
writePropertyin interfaceDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>- Type Parameters:
E- the type which gets read/written by the given property.- Parameters:
property- the property to write.value- the value to associate with the given property.- Returns:
- this property holder, for chaining.
-
writePropertyIfAbsent
@NonNull default <E> S writePropertyIfAbsent(@NonNull @NonNull DocProperty<E> property, @Nullable E value) Writes the given property and value into the underlying document if no other value is associated yet with the given property.- Specified by:
writePropertyIfAbsentin interfaceDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>- Type Parameters:
E- the type which gets read/written by the given property.- Parameters:
property- the property to write.value- the value to associate with the given property in case no other value is associated yet.- Returns:
- this property holder, for chaining.
-
writePropertyIfAbsent
@NonNull default <E> S writePropertyIfAbsent(@NonNull @NonNull DocProperty<E> property, @NonNull @NonNull Supplier<? extends E> valueSupplier) Writes the given property and computed value into the underlying document if no other value is associated yet with the given property.- Specified by:
writePropertyIfAbsentin interfaceDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>- Type Parameters:
E- the type which gets read/written by the given property.- Parameters:
property- the property to write.valueSupplier- a supplier for the value to associate if no other value is yet associated.- Returns:
- this property holder, for chaining.
-
writePropertyIfPresent
@NonNull default <E> S writePropertyIfPresent(@NonNull @NonNull DocProperty<E> property, @Nullable E val) Writes the given property and value into the underlying document if another value is already associated with the given property.- Specified by:
writePropertyIfPresentin interfaceDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>- Type Parameters:
E- the type which gets read/written by the given property.- Parameters:
property- the property to write.val- the value to associate with the given property in case another value is already associated.- Returns:
- this property holder, for chaining.
-
writePropertyIfPresent
@NonNull default <E> S writePropertyIfPresent(@NonNull @NonNull DocProperty<E> property, @NonNull @NonNull Supplier<? extends E> valueSupplier) Writes the given property and computed value into the underlying document if another value is already associated with the given property.- Specified by:
writePropertyIfPresentin interfaceDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>- Type Parameters:
E- the type which gets read/written by the given property.- Parameters:
property- the property to write.valueSupplier- a supplier for the value to associate if another value is already associated.- Returns:
- this property holder, for chaining.
-
removeProperty
Removes the given doc property from the underlying document.- Specified by:
removePropertyin interfaceDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>- Type Parameters:
E- the type which gets read/written by the given property.- Parameters:
property- the property to remove.- Returns:
- the old value associated with the given doc property.
-