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
  • Method Details

    • modifyProperties

      @NonNull default S modifyProperties(@NonNull @NonNull Consumer<Document.Mutable> propertyModifier)
      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.