Class Parameter.Builder
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.configuration.model.Parameter.Builder
-
- Enclosing class:
- Parameter
public static final class Parameter.Builder extends Object
Realizes the builder pattern for aParameter
. Starting point isParameter.parameter(String)
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Parameter
build()
Builds a new parameter.Parameter.Builder
value(Object value)
Adds on new value to the parameter.Parameter.Builder
values(Object... values)
Adds all new values to the parameter.
-
-
-
Method Detail
-
value
public Parameter.Builder value(Object value)
Adds on new value to the parameter. The value will have the number of previous values as an id and the given object as data.If a
Value.Builder
is given as a parameter the value will be build from the builder.- Parameters:
value
- the value object to be added. May benull
as it will be wrapped inValue
- Returns:
- this
-
values
public Parameter.Builder values(Object... values)
Adds all new values to the parameter. The values will have the ids starting at the number of previous values, and the objects as data.If a
Value.Builder
is given as a parameter the value will be build from the builder.- Parameters:
values
- the value objects to be added. May benull
each as they will be wrapped inValue
- Returns:
- this
-
build
public Parameter build()
Builds a new parameter. If less than two values were added, this will throw an exception.- Returns:
- the constructed parameter
-
-