Package io.dialob.api.questionnaire
Class ImmutableQuestionnaireMetadata.Builder
- java.lang.Object
-
- io.dialob.api.questionnaire.ImmutableQuestionnaireMetadata.Builder
-
- Enclosing class:
- ImmutableQuestionnaireMetadata
@NotThreadSafe public static final class ImmutableQuestionnaireMetadata.Builder extends Object
Builds instances of typeImmutableQuestionnaireMetadata. 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 ImmutableQuestionnaireMetadata.Builder from(ModifiableQuestionnaireMetadata instance)
Fill a builder with attribute values from the providedModifiableQuestionnaireMetadatainstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final ImmutableQuestionnaireMetadata.Builder from(Questionnaire.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
-
formId
public final ImmutableQuestionnaireMetadata.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
-
formName
public final ImmutableQuestionnaireMetadata.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
-
status
public final ImmutableQuestionnaireMetadata.Builder status(Questionnaire.Metadata.Status status)
Initializes the value for thestatusattribute.If not set, this attribute will have a default value as returned by the initializer of
status.- Parameters:
status- The value for status- Returns:
thisbuilder for use in a chained invocation
-
formRev
public final ImmutableQuestionnaireMetadata.Builder formRev(String formRev)
Initializes the value for theformRevattribute.- Parameters:
formRev- The value for formRev (can benull)- Returns:
thisbuilder for use in a chained invocation
-
tenantId
public final ImmutableQuestionnaireMetadata.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
-
created
public final ImmutableQuestionnaireMetadata.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
-
lastAnswer
public final ImmutableQuestionnaireMetadata.Builder lastAnswer(Date lastAnswer)
Initializes the value for thelastAnswerattribute.- Parameters:
lastAnswer- The value for lastAnswer (can benull)- Returns:
thisbuilder for use in a chained invocation
-
opened
public final ImmutableQuestionnaireMetadata.Builder opened(Date opened)
Initializes the value for theopenedattribute.- Parameters:
opened- The value for opened (can benull)- Returns:
thisbuilder for use in a chained invocation
-
completed
public final ImmutableQuestionnaireMetadata.Builder completed(Date completed)
Initializes the value for thecompletedattribute.- Parameters:
completed- The value for completed (can benull)- Returns:
thisbuilder for use in a chained invocation
-
label
public final ImmutableQuestionnaireMetadata.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
-
submitUrl
public final ImmutableQuestionnaireMetadata.Builder submitUrl(String submitUrl)
Initializes the value for thesubmitUrlattribute.- Parameters:
submitUrl- The value for submitUrl (can benull)- Returns:
thisbuilder for use in a chained invocation
-
reason
public final ImmutableQuestionnaireMetadata.Builder reason(Questionnaire.Metadata.Reason reason)
Initializes the value for thereasonattribute.- Parameters:
reason- The value for reason (can benull)- Returns:
thisbuilder for use in a chained invocation
-
language
public final ImmutableQuestionnaireMetadata.Builder language(String language)
Initializes the value for thelanguageattribute.- Parameters:
language- The value for language (can benull)- Returns:
thisbuilder for use in a chained invocation
-
owner
public final ImmutableQuestionnaireMetadata.Builder owner(String owner)
Initializes the value for theownerattribute.- Parameters:
owner- The value for owner (can benull)- Returns:
thisbuilder for use in a chained invocation
-
creator
public final ImmutableQuestionnaireMetadata.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
-
putAdditionalProperties
public final ImmutableQuestionnaireMetadata.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 ImmutableQuestionnaireMetadata.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 ImmutableQuestionnaireMetadata.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 ImmutableQuestionnaireMetadata.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 ImmutableQuestionnaireMetadata build()
Builds a newImmutableQuestionnaireMetadata.- Returns:
- An immutable instance of Metadata
- Throws:
IllegalStateException- if any required attributes are missing
-
-