T - of object provided@FunctionalInterface public interface Builder<T> extends Supplier<T>
| Modifier and Type | Method and Description |
|---|---|
T |
build()
Builds and returns a non-null T instance.
|
default T |
get() |
@NotNull T build()
The builder should always creates a new instance if the instance is mutable. If the instance is immutable, the builder may create a new instance, or it may return a previously existing instance at its own discretion.
As opposed to a factory, a Builder is often only able to be invoked at most one time.
IllegalStateException - if the builder is can only be invoked once
and this method is invoked more than once.Copyright © 2024. All rights reserved.