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

    • writeProperty

      @NonNull default <E> S writeProperty(@NonNull @NonNull DocProperty<E> property, @Nullable E value)
      Writes the given property and value into the underlying document.
      Specified by:
      writeProperty in interface DocPropertyHolder.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:
      writePropertyIfAbsent in interface DocPropertyHolder.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:
      writePropertyIfAbsent in interface DocPropertyHolder.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:
      writePropertyIfPresent in interface DocPropertyHolder.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:
      writePropertyIfPresent in interface DocPropertyHolder.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

      @Nullable default <E> E removeProperty(@NonNull @NonNull DocProperty<E> property)
      Removes the given doc property from the underlying document.
      Specified by:
      removeProperty in interface DocPropertyHolder.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.