Package de.xima.fc.workflow
Class Setting.Builder<TValue>
- java.lang.Object
-
- de.xima.fc.workflow.Setting.Builder<TValue>
-
- Type Parameters:
TValue
- Type of the settings' value.
- All Implemented Interfaces:
org.apache.commons.lang3.builder.Builder<Setting<TValue>>
public static class Setting.Builder<TValue> extends Object implements org.apache.commons.lang3.builder.Builder<Setting<TValue>>
A builder for configuring the options of aSetting
. Only the name and value of a setting can be edited, other options are set when the setting is created.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description Builder()
Creates a new setting builder with the default values.
-
Method Summary
-
-
-
Method Detail
-
build
public Setting<TValue> build()
- Specified by:
build
in interfaceorg.apache.commons.lang3.builder.Builder<TValue>
-
deletable
public Setting.Builder<TValue> deletable()
Makes the setting deletable. Settings are deletable by default.- Returns:
- this for chaining
- See Also:
Setting.isDeletable()
-
deletable
public Setting.Builder<TValue> deletable(boolean deletable)
- Parameters:
deletable
- Whether the setting can be deleted. Settings are deletable by default.- Returns:
- this for chaining
- See Also:
Setting.isDeletable()
-
description
public Setting.Builder<TValue> description(String localizedDescription)
- Parameters:
localizedDescription
- A human-readable description of the setting. Default to no description.- Returns:
- this for chaining
- See Also:
Setting.getLocalizedDescription()
-
localizedName
public Setting.Builder<TValue> localizedName(String localizedName)
- Parameters:
localizedName
- A human-readable name of the setting. Defaults to the name of the parameter.- Returns:
- this for chaining
- See Also:
Setting.getLocalizedName()
-
name
public Setting.Builder<TValue> name(String name)
- Parameters:
name
- The technical name of the setting. By default no name is set (and must be entered by the user). If you assign a predefined name, you should setnameEditable()
totrue
.- Returns:
- this for chaining
- See Also:
Setting.getName()
-
nameEditable
public Setting.Builder<TValue> nameEditable()
Makes the name of the setting editable. Defaults totrue
.- Returns:
- this for chaining
- See Also:
Setting.isNameEditable()
-
nameEditable
public Setting.Builder<TValue> nameEditable(boolean nameEditable)
- Parameters:
nameEditable
- Whether the name of the setting is editable. Defaults totrue
. When you set this tofalse
, you should also setname(String)
.- Returns:
- this for chaining
- See Also:
Setting.isNameEditable()
-
nameNotEditable
public Setting.Builder<TValue> nameNotEditable()
Makes the name of the setting not editable. Defaults totrue
. When you use this, you should also setname(String)
for the setting.- Returns:
- this for chaining
- See Also:
Setting.isNameEditable()
-
required
public Setting.Builder<TValue> required()
Marks the setting as required, i.e. a value has to be entered. Default tofalse
.- Returns:
- this for chaining.
- See Also:
Setting.isRequired()
-
required
public Setting.Builder<TValue> required(boolean required)
- Parameters:
required
- Whether the setting is required, i.e. whether a value has to be entered. Default tofalse
.- Returns:
- this for chaining.
- See Also:
Setting.isRequired()
-
value
public Setting.Builder<TValue> value(TValue value)
- Parameters:
value
- The initial value for the setting. Defaults tonull
.- Returns:
- this for chaining.
- See Also:
Setting.getValue()
-
valueEditable
public Setting.Builder<TValue> valueEditable()
Marks the value of the setting as editable. Defaults totrue
.- Returns:
- this for chaining
- See Also:
Setting.isValueEditable()
-
valueEditable
public Setting.Builder<TValue> valueEditable(boolean valueEditable)
- Parameters:
valueEditable
- Whether the value of the setting is editable. Defaults totrue
. When you set this tofalse
, you should either set a defaultvalue(Object)
or setrequired(boolean)
tofalse
.- Returns:
- this for chaining
- See Also:
Setting.isValueEditable()
-
valueNotEditable
public Setting.Builder<TValue> valueNotEditable()
Marks the value of the setting as not editable. Defaults totrue
. When you use this, you should either set a defaultvalue(Object)
or setrequired(boolean)
tofalse
.- Returns:
- this for chaining
- See Also:
Setting.isValueEditable()
-
-