AbstractSupplier (Apache Commons Lang 3.20.0 API)
Description: declaration: package: org.apache.commons.lang3.builder, class: AbstractSupplier

# Class AbstractSupplier<T, B extends AbstractSupplier<T,B,E>, E extends Throwable>

java.lang.Object
org.apache.commons.lang3.builder.AbstractSupplier<T,B,E>

Type Parameters:
  `T` - The type of results supplied by this supplier.
  `B` - the type of builder.
  `E` - The kind of thrown exception or error.

All Implemented Interfaces:
  `FailableSupplier<T,E>`

Direct Known Subclasses:
  `AbstractConcurrentInitializer.AbstractBuilder, LockingVisitors.LockVisitor.LVBuilder, Strings.Builder`

public abstract class AbstractSupplier<T, B extends AbstractSupplier<T,B,E>, E extends Throwable> extends Object implements FailableSupplier<T,E>
Abstracts supplying an instance of `T`. Use to implement the builder pattern.

Since:
  3.14.0

- ## Field Summary

  ### Fields inherited from interface FailableSupplier

  `NUL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractSupplier()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected B`
  `asThis()`
  Returns this instance typed as the subclass type `B`.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface FailableSupplier

  `get`

- ## Constructor Details

  - ### AbstractSupplier

    public AbstractSupplier()
    Constructs a new instance.

- ## Method Details

  - ### asThis

    protected B asThis()
    Returns this instance typed as the subclass type `B`.

    This is the same as the expression:

        (B) this

    Returns:
      `this` instance typed as the subclass type `B`.