Interface DefaultedDocPropertyHolder.Mutable.WithDirectModifier<S extends DocPropertyHolder.Mutable<S>>
- Type Parameters:
S- the type that implements this interface, for chainable method return types.
- All Superinterfaces:
DefaultedDocPropertyHolder, DefaultedDocPropertyHolder.Mutable<S>, DocPropertyHolder, DocPropertyHolder.Mutable<S>
- All Known Implementing Classes:
GroupConfiguration.Builder, ServiceConfiguration.Builder, ServiceConfigurationBase.Builder, ServiceTask.Builder
- Enclosing interface:
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>>
public static interface DefaultedDocPropertyHolder.Mutable.WithDirectModifier<S extends DocPropertyHolder.Mutable<S>>
extends DefaultedDocPropertyHolder.Mutable<S>
A subclass of a mutable doc property holder which allows to modify the underlying property document of this
holder easily.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S>Nested classes/interfaces inherited from interface DefaultedDocPropertyHolder.Mutable
DefaultedDocPropertyHolder.Mutable.WithDirectModifier<S>Nested classes/interfaces inherited from interface DocPropertyHolder
DocPropertyHolder.Mutable<S> -
Method Summary
Modifier and TypeMethodDescriptiondefault SmodifyAndSetProperties(@NonNull Function<Document.Mutable, ? extends Document> modifier) Applies the given operator to the underlying document and copies over all items from the underlying document into this holder.default SmodifyProperties(@NonNull Consumer<Document.Mutable> propertyModifier) Passes the underlying mutable document of this holder to the given modifier function.Methods inherited from interface DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrowMethods inherited from interface DefaultedDocPropertyHolder.Mutable
removeProperty, writeProperty, writePropertyIfAbsent, writePropertyIfAbsent, writePropertyIfPresent, writePropertyIfPresentMethods inherited from interface DocPropertyHolder.Mutable
propertyHolder
-
Method Details
-
modifyProperties
Passes the underlying mutable document of this holder to the given modifier function. It is up to the function which changes are applied to the document. All changes made inside the modifier (without copying the passed document) will reflect into this holder.- Parameters:
propertyModifier- the modifier function to apply to the underlying document.- Returns:
- this property holder, for chaining.
- Throws:
NullPointerException- if the given modifier function is null.
-
modifyAndSetProperties
@NonNull default S modifyAndSetProperties(@NonNull @NonNull Function<Document.Mutable, ? extends Document> modifier) Applies the given operator to the underlying document and copies over all items from the underlying document into this holder. Properties that were added prior to the method invocation will be removed.- Parameters:
modifier- the modifier operator to apply to the underlying document.- Returns:
- this property holder, for chaining.
- Throws:
NullPointerException- if the given modifier operator is null.
-