Interface DocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>
- Type Parameters:
S- the type that implements this interface, for chainable method return types.
- All Superinterfaces:
DocPropertyHolder
- All Known Subinterfaces:
DefaultedDocPropertyHolder.Mutable<S>, DefaultedDocPropertyHolder.Mutable.WithDirectModifier<S>, Document.Mutable
- All Known Implementing Classes:
GroupConfiguration.Builder, ServiceConfiguration.Builder, ServiceConfigurationBase.Builder, ServiceTask.Builder
- Enclosing interface:
DocPropertyHolder
public static interface DocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>
extends DocPropertyHolder
A mutable version of a doc property holder which allows modifications to it.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface DocPropertyHolder
DocPropertyHolder.Mutable<S> -
Method Summary
Modifier and TypeMethodDescriptionGet the underlying document that all read and write operations are delegated to.<E> @UnknownNullability EremoveProperty(@NonNull DocProperty<E> property) Removes the given doc property from the underlying document.<E> SwriteProperty(@NonNull DocProperty<E> property, E value) Writes the given property and value into the underlying document.<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.<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.<E> SwritePropertyIfPresent(@NonNull DocProperty<E> property, E value) Writes the given property and value into the underlying document if another value is already associated with the given property.<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 DocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Method Details
-
writeProperty
Writes the given property and value into the underlying document.- 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.
- Throws:
NullPointerException- if the given doc property is null.UnsupportedOperationException- if the given doc property does not support writing.
-
writePropertyIfAbsent
Writes the given property and value into the underlying document if no other value is associated yet with the given property.- 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.
- Throws:
NullPointerException- if the given doc property is null.UnsupportedOperationException- if the given doc property does not support writing.
-
writePropertyIfAbsent
@NonNull <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.- 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.
- Throws:
NullPointerException- if the given doc property or value supplier is null.UnsupportedOperationException- if the given doc property does not support writing.
-
writePropertyIfPresent
Writes the given property and value into the underlying document if another value is already associated with the given property.- 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 another value is already associated.- Returns:
- this property holder, for chaining.
- Throws:
NullPointerException- if the given doc property is null.UnsupportedOperationException- if the given doc property does not support writing.
-
writePropertyIfPresent
@NonNull <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.- 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.
- Throws:
NullPointerException- if the given doc property or value supplier is null.UnsupportedOperationException- if the given doc property does not support writing.
-
removeProperty
Removes the given doc property from the underlying document.- 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.
- Throws:
NullPointerException- if the given property is null.UnsupportedOperationException- if the given doc property is read-only.
-
propertyHolder
Get the underlying document that all read and write operations are delegated to.- Specified by:
propertyHolderin interfaceDocPropertyHolder- Returns:
- the underlying document.
-