T - Object Argumentpublic class BuilderArgument<T>
extends java.lang.Object
| Constructor and Description |
|---|
BuilderArgument(java.lang.String objectName)
Construct a new basic BuilderArgument.
|
BuilderArgument(java.lang.String objectName,
@NotNull java.util.function.Supplier<T> initialValue)
Construct a new BuilderArgument.
|
BuilderArgument(java.lang.String objectName,
@NotNull java.util.function.Supplier<T> initialValue,
@NotNull java.util.function.Supplier<T> badObject)
Construct a new BuilderArgument.
|
BuilderArgument(@NotNull java.util.function.Supplier<T> badObject,
java.lang.String objectName)
Construct a new BuilderArgument.
|
| Modifier and Type | Method and Description |
|---|---|
T |
badObject()
Get the bad object.
|
T |
get()
Check and get the wrapped object.
|
java.lang.String |
getObjectName()
Get the name of the current object's name.
|
BuilderArgument<T> |
optional()
Indicate that argument is optional.
|
BuilderArgument<T> |
require(BuilderArgument<?>... required)
Indicate that provided arguments are required if this argument is built.
|
BuilderArgument<T> |
required()
Indicate that argument is required.
|
void |
set(T object)
Define the new wrapped object.
|
java.lang.String |
toString() |
public BuilderArgument(java.lang.String objectName,
@NotNull
@NotNull java.util.function.Supplier<T> initialValue)
objectName - The name of the object.initialValue - The initial value's wrapper.public BuilderArgument(java.lang.String objectName)
objectName - The name of the object.public BuilderArgument(java.lang.String objectName,
@NotNull
@NotNull java.util.function.Supplier<T> initialValue,
@NotNull
@NotNull java.util.function.Supplier<T> badObject)
objectName - The name of the object.initialValue - The initial value's wrapper.badObject - The initial bad value's wrapper.public BuilderArgument(@NotNull
@NotNull java.util.function.Supplier<T> badObject,
java.lang.String objectName)
badObject - The initial bad value's wrapper.objectName - The name of the object.public T get() throws BuilderException
BuilderException - it the builder configuration is invalid.public void set(T object)
object - the new wrapper object to define.public BuilderArgument<T> require(BuilderArgument<?>... required)
required - required arguments.public BuilderArgument<T> required()
public BuilderArgument<T> optional()
public java.lang.String getObjectName()
public T badObject()
public java.lang.String toString()
toString in class java.lang.Object