Class BuilderArgument<T>
java.lang.Object
fr.flowarg.flowupdater.utils.builderapi.BuilderArgument<T>
- Type Parameters:
T- Object Argument
Builder API; Represent an argument for a Builder implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilderArgument(@NotNull Supplier<T> badObject, String objectName) Construct a new BuilderArgument.BuilderArgument(String objectName) Construct a new basic BuilderArgument.BuilderArgument(String objectName, @NotNull Supplier<T> initialValue) Construct a new BuilderArgument.BuilderArgument(String objectName, @NotNull Supplier<T> initialValue, @NotNull Supplier<T> badObject) Construct a new BuilderArgument. -
Method Summary
Modifier and TypeMethodDescriptionGet the bad object.get()Check and get the wrapped object.Get the name of the current object's name.optional()Indicate that argument is optional.require(BuilderArgument<?> @NotNull ... required) Indicate that provided arguments are required if this argument is built.required()Indicate that argument is required.voidDefine the new wrapped object.toString()
-
Constructor Details
-
BuilderArgument
Construct a new BuilderArgument.- Parameters:
objectName- The name of the object.initialValue- The initial value's wrapper.
-
BuilderArgument
Construct a new basic BuilderArgument.- Parameters:
objectName- The name of the object.
-
BuilderArgument
public BuilderArgument(String objectName, @NotNull @NotNull Supplier<T> initialValue, @NotNull @NotNull Supplier<T> badObject) Construct a new BuilderArgument.- Parameters:
objectName- The name of the object.initialValue- The initial value's wrapper.badObject- The initial bad value's wrapper.
-
BuilderArgument
Construct a new BuilderArgument.- Parameters:
badObject- The initial bad value's wrapper.objectName- The name of the object.
-
-
Method Details
-
get
Check and get the wrapped object.- Returns:
- the wrapper object.
- Throws:
BuilderException- it the builder configuration is invalid.
-
set
Define the new wrapped object.- Parameters:
object- the new wrapper object to define.
-
require
Indicate that provided arguments are required if this argument is built.- Parameters:
required- required arguments.- Returns:
- this.
-
required
Indicate that argument is required.- Returns:
- this.
-
optional
Indicate that argument is optional.- Returns:
- this.
-
getObjectName
Get the name of the current object's name.- Returns:
- the object's name.
-
badObject
Get the bad object.- Returns:
- the bad object.
-
toString
-