Package io.dialob.api.form
Class ImmutableFormTag.Builder
java.lang.Object
io.dialob.api.form.ImmutableFormTag.Builder
- Enclosing class:
- ImmutableFormTag
Builds instances of type
ImmutableFormTag.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableFormTag.final ImmutableFormTag.BuilderInitializes the value for thecreatedattribute.final ImmutableFormTag.Builderdescription(String description) Initializes the value for thedescriptionattribute.final ImmutableFormTag.BuilderInitializes the value for theformIdattribute.final ImmutableFormTag.BuilderInitializes the value for theformNameattribute.final ImmutableFormTag.BuilderFill a builder with attribute values from the providedFormTaginstance.final ImmutableFormTag.BuilderInitializes the value for thenameattribute.final ImmutableFormTag.BuilderInitializes the value for therefNameattribute.final ImmutableFormTag.Buildertype(FormTag.Type type) Initializes the value for thetypeattribute.
-
Method Details
-
from
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
Initializes the value for theformNameattribute.- Parameters:
formName- The value for formName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
refName
Initializes the value for therefNameattribute.- Parameters:
refName- The value for refName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
created
Initializes the value for thecreatedattribute.- Parameters:
created- The value for created (can benull)- Returns:
thisbuilder for use in a chained invocation
-
formId
Initializes the value for theformIdattribute.- Parameters:
formId- The value for formId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
description
Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description (can benull)- Returns:
thisbuilder for use in a chained invocation
-
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
Builds a newImmutableFormTag.- Returns:
- An immutable instance of FormTag
- Throws:
IllegalStateException- if any required attributes are missing
-