Interface Builder<T>

  • Type Parameters:
    T - Type of the built instance
    All Superinterfaces:
    Supplier<T>
    All Known Implementing Classes:
    SerializationConfig.Builder
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Builder<T>
    extends Supplier<T>
    Interface for builders, to be able to accept a builder in addition to an instance.

    This interface is similar to Supplier as it provides an instance, only for classes that act as instance builders (fluent API builder pattern), where method Supplier.get() would be misleading.

    • Method Detail

      • build

        T build()
        Build the instance from this builder.
        Returns:
        instance of the built type
      • get

        default T get()
        Specified by:
        get in interface Supplier<T>