Package io.dialob.api.form
Class ImmutableFormMetadata.Builder
- java.lang.Object
-
- io.dialob.api.form.ImmutableFormMetadata.Builder
-
- Enclosing class:
- ImmutableFormMetadata
@NotThreadSafe public static final class ImmutableFormMetadata.Builder extends Object
Builds instances of typeImmutableFormMetadata. 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
-
-
-
Method Detail
-
from
public final ImmutableFormMetadata.Builder from(ModifiableFormMetadata instance)
Fill a builder with attribute values from the providedModifiableFormMetadatainstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final ImmutableFormMetadata.Builder from(Form.Metadata instance)
Fill a builder with attribute values from the providedMetadatainstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
label
public final ImmutableFormMetadata.Builder label(String label)
Initializes the value for thelabelattribute.- Parameters:
label- The value for label (can benull)- Returns:
thisbuilder for use in a chained invocation
-
created
public final ImmutableFormMetadata.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
-
lastSaved
public final ImmutableFormMetadata.Builder lastSaved(Date lastSaved)
Initializes the value for thelastSavedattribute.- Parameters:
lastSaved- The value for lastSaved (can benull)- Returns:
thisbuilder for use in a chained invocation
-
valid
public final ImmutableFormMetadata.Builder valid(Boolean valid)
Initializes the value for thevalidattribute.- Parameters:
valid- The value for valid (can benull)- Returns:
thisbuilder for use in a chained invocation
-
creator
public final ImmutableFormMetadata.Builder creator(String creator)
Initializes the value for thecreatorattribute.- Parameters:
creator- The value for creator (can benull)- Returns:
thisbuilder for use in a chained invocation
-
tenantId
public final ImmutableFormMetadata.Builder tenantId(String tenantId)
Initializes the value for thetenantIdattribute.- Parameters:
tenantId- The value for tenantId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
savedBy
public final ImmutableFormMetadata.Builder savedBy(String savedBy)
Initializes the value for thesavedByattribute.- Parameters:
savedBy- The value for savedBy (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addLabels
public final ImmutableFormMetadata.Builder addLabels(@Nullable String element)
Adds one element tolabelsset.- Parameters:
element- A labels element- Returns:
thisbuilder for use in a chained invocation
-
addLabels
public final ImmutableFormMetadata.Builder addLabels(String... elements)
Adds elements tolabelsset.- Parameters:
elements- An array of labels elements- Returns:
thisbuilder for use in a chained invocation
-
labels
public final ImmutableFormMetadata.Builder labels(Iterable<String> elements)
Sets or replaces all elements forlabelsset.- Parameters:
elements- An iterable of labels elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLabels
public final ImmutableFormMetadata.Builder addAllLabels(Iterable<String> elements)
Adds elements tolabelsset.- Parameters:
elements- An iterable of labels elements- Returns:
thisbuilder for use in a chained invocation
-
defaultSubmitUrl
public final ImmutableFormMetadata.Builder defaultSubmitUrl(String defaultSubmitUrl)
Initializes the value for thedefaultSubmitUrlattribute.- Parameters:
defaultSubmitUrl- The value for defaultSubmitUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addLanguages
public final ImmutableFormMetadata.Builder addLanguages(@Nullable String element)
Adds one element tolanguagesset.- Parameters:
element- A languages element- Returns:
thisbuilder for use in a chained invocation
-
addLanguages
public final ImmutableFormMetadata.Builder addLanguages(String... elements)
Adds elements tolanguagesset.- Parameters:
elements- An array of languages elements- Returns:
thisbuilder for use in a chained invocation
-
languages
public final ImmutableFormMetadata.Builder languages(Iterable<String> elements)
Sets or replaces all elements forlanguagesset.- Parameters:
elements- An iterable of languages elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLanguages
public final ImmutableFormMetadata.Builder addAllLanguages(Iterable<String> elements)
Adds elements tolanguagesset.- Parameters:
elements- An iterable of languages elements- Returns:
thisbuilder for use in a chained invocation
-
putAdditionalProperties
public final ImmutableFormMetadata.Builder putAdditionalProperties(@Nullable String key, @Nullable Object value)
Put one entry to theadditionalPropertiesmap.- Parameters:
key- The key in the additionalProperties mapvalue- The associated value in the additionalProperties map- Returns:
thisbuilder for use in a chained invocation
-
putAdditionalProperties
public final ImmutableFormMetadata.Builder putAdditionalProperties(Map.Entry<String,? extends Object> entry)
Put one entry to theadditionalPropertiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
additionalProperties
public final ImmutableFormMetadata.Builder additionalProperties(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for theadditionalPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the additionalProperties map- Returns:
thisbuilder for use in a chained invocation
-
putAllAdditionalProperties
public final ImmutableFormMetadata.Builder putAllAdditionalProperties(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries toadditionalPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the additionalProperties map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableFormMetadata build()
Builds a newImmutableFormMetadata.- Returns:
- An immutable instance of Metadata
- Throws:
IllegalStateException- if any required attributes are missing
-
-