Class AbstractBuilder<R,T extends AbstractBuilder<?,T>>

java.lang.Object
com._1c.g5.aef2.standard.definitions.builders.AbstractBuilder<R,T>
Type Parameters:
R - the building object type.
T - the type of the builder.
Direct Known Subclasses:
AbstractContainerDefinitionBuilder, DtGranularEditorPageActionBuilder, DtGranularEditorPageBuilder, DtGranularEditorPageTwoColumnBuilder, SetupDefinitionBuilder

public abstract class AbstractBuilder<R,T extends AbstractBuilder<?,T>> extends Object
The basic class for definition builders.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Initializes a builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected T
    apply(Consumer<R> action)
    Applies the given action to object to build and returns the builder instance.
    protected R
    Actually just returns the object that is building with the current state.
    protected final T
    Returns the self object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder(Supplier<R> provider)
      Initializes a builder.
      Parameters:
      provider - the provider of object to build, cannot be null.
  • Method Details

    • apply

      protected T apply(Consumer<R> action)
      Applies the given action to object to build and returns the builder instance.
      Parameters:
      action - the action to apply.
      Returns:
      the builder instance.
    • build

      protected R build()
      Actually just returns the object that is building with the current state.
      Returns:
      the built object.
    • self

      protected final T self()
      Returns the self object.
      Returns:
      the self object.