Package io.dialob.api.form
Class ImmutableFormTag.Builder
- java.lang.Object
-
- io.dialob.api.form.ImmutableFormTag.Builder
-
- Enclosing class:
- ImmutableFormTag
@NotThreadSafe public static final class ImmutableFormTag.Builder extends Object
Builds instances of typeImmutableFormTag. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableFormTagbuild()Builds a newImmutableFormTag.ImmutableFormTag.Buildercreated(Date created)Initializes the value for thecreatedattribute.ImmutableFormTag.Builderdescription(String description)Initializes the value for thedescriptionattribute.ImmutableFormTag.BuilderformId(String formId)Initializes the value for theformIdattribute.ImmutableFormTag.BuilderformName(String formName)Initializes the value for theformNameattribute.ImmutableFormTag.Builderfrom(FormTag instance)Fill a builder with attribute values from the providedFormTaginstance.ImmutableFormTag.Buildername(String name)Initializes the value for thenameattribute.ImmutableFormTag.BuilderrefName(String refName)Initializes the value for therefNameattribute.ImmutableFormTag.Buildertype(FormTag.Type type)Initializes the value for thetypeattribute.
-
-
-
Method Detail
-
from
public final ImmutableFormTag.Builder from(FormTag instance)
Fill a builder with attribute values from the providedFormTaginstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
formName
public final ImmutableFormTag.Builder formName(String formName)
Initializes the value for theformNameattribute.- Parameters:
formName- The value for formName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
public final ImmutableFormTag.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
refName
public final ImmutableFormTag.Builder refName(String refName)
Initializes the value for therefNameattribute.- Parameters:
refName- The value for refName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
created
public final ImmutableFormTag.Builder created(Date created)
Initializes the value for thecreatedattribute.- Parameters:
created- The value for created (can benull)- Returns:
thisbuilder for use in a chained invocation
-
formId
public final ImmutableFormTag.Builder formId(String formId)
Initializes the value for theformIdattribute.- Parameters:
formId- The value for formId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
public final ImmutableFormTag.Builder description(String description)
Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description (can benull)- Returns:
thisbuilder for use in a chained invocation
-
type
public final ImmutableFormTag.Builder type(FormTag.Type type)
Initializes the value for thetypeattribute.If not set, this attribute will have a default value as returned by the initializer of
type.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableFormTag build()
Builds a newImmutableFormTag.- Returns:
- An immutable instance of FormTag
- Throws:
IllegalStateException- if any required attributes are missing
-
-