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

    • Constructor Detail

      • AbstractBuilder

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

      • 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.