Package io.dialob.api.questionnaire
Class ModifiableQuestionnaire
- java.lang.Object
-
- io.dialob.api.questionnaire.ModifiableQuestionnaire
-
- All Implemented Interfaces:
Questionnaire,WithValidation<Questionnaire>,Serializable
@ParametersAreNonnullByDefault @Generated({"Modifiables.generator","Questionnaire"}) @NotThreadSafe public final class ModifiableQuestionnaire extends Object implements Questionnaire
A modifiable implementation of theQuestionnairetype.Use the
create()static factory methods to create new instances. Use thetoImmutable()method to convert to canonical immutable instances.ModifiableQuestionnaire is not thread-safe
- See Also:
ImmutableQuestionnaire, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.dialob.api.questionnaire.Questionnaire
Questionnaire.Metadata
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableQuestionnaireaddAllAnswers(Iterable<? extends Answer> elements)Adds elements toanswerslist.ModifiableQuestionnaireaddAllContext(Iterable<? extends ContextValue> elements)Adds elements tocontextlist.ModifiableQuestionnaireaddAllErrors(Iterable<? extends Error> elements)Adds elements toerrorslist.ModifiableQuestionnaireaddAllValueSets(Iterable<? extends ValueSet> elements)Adds elements tovalueSetslist.ModifiableQuestionnaireaddAllVariableValues(Iterable<? extends VariableValue> elements)Adds elements tovariableValueslist.ModifiableQuestionnaireaddAnswers(Answer element)Adds one element toanswerslist.ModifiableQuestionnaireaddAnswers(Answer... elements)Adds elements toanswerslist.ModifiableQuestionnaireaddContext(ContextValue element)Adds one element tocontextlist.ModifiableQuestionnaireaddContext(ContextValue... elements)Adds elements tocontextlist.ModifiableQuestionnaireaddErrors(Error element)Adds one element toerrorslist.ModifiableQuestionnaireaddErrors(Error... elements)Adds elements toerrorslist.ModifiableQuestionnaireaddValueSets(ValueSet element)Adds one element tovalueSetslist.ModifiableQuestionnaireaddValueSets(ValueSet... elements)Adds elements tovalueSetslist.ModifiableQuestionnaireaddVariableValues(VariableValue element)Adds one element tovariableValueslist.ModifiableQuestionnaireaddVariableValues(VariableValue... elements)Adds elements tovariableValueslist.ModifiableQuestionnaireclear()Clears the object by setting all attributes to their initial values.static ModifiableQuestionnairecreate()Construct a modifiable instance ofQuestionnaire.booleanequals(Object another)This instance is equal to all instances ofModifiableQuestionnairethat have equal attribute values.ModifiableQuestionnairefrom(ModifiableQuestionnaire instance)Fill this modifiable instance with attribute values from the providedQuestionnaireinstance.ModifiableQuestionnairefrom(Questionnaire instance)Fill this modifiable instance with attribute values from the providedQuestionnaireinstance.StringgetActiveItem()List<Answer>getAnswers()List<ContextValue>getContext()List<Error>getErrors()StringgetId()ModifiableQuestionnaireMetadatagetMetadata()StringgetRev()List<ValueSet>getValueSets()List<VariableValue>getVariableValues()inthashCode()Computes a hash code from attributes:id,rev,answers,context,activeItem,errors,variableValues,valueSets,metadata.booleanisInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.ModifiableQuestionnairesetActiveItem(String activeItem)Assigns a value to theactiveItemattribute.ModifiableQuestionnairesetAnswers(Iterable<? extends Answer> elements)Sets or replaces all elements foranswerslist.ModifiableQuestionnairesetContext(Iterable<? extends ContextValue> elements)Sets or replaces all elements forcontextlist.ModifiableQuestionnairesetErrors(Iterable<? extends Error> elements)Sets or replaces all elements forerrorslist.ModifiableQuestionnairesetId(String id)Assigns a value to theidattribute.ModifiableQuestionnairesetMetadata(Questionnaire.Metadata metadata)Assigns a value to themetadataattribute.ModifiableQuestionnairesetRev(String rev)Assigns a value to therevattribute.ModifiableQuestionnairesetValueSets(Iterable<? extends ValueSet> elements)Sets or replaces all elements forvalueSetslist.ModifiableQuestionnairesetVariableValues(Iterable<? extends VariableValue> elements)Sets or replaces all elements forvariableValueslist.ImmutableQuestionnairetoImmutable()Converts toImmutableQuestionnaire.StringtoString()Generates a string representation of thisQuestionnaire.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.dialob.api.validation.WithValidation
validate
-
-
-
-
Method Detail
-
create
public static ModifiableQuestionnaire create()
Construct a modifiable instance ofQuestionnaire.- Returns:
- A new modifiable instance
-
getId
public final String getId()
- Specified by:
getIdin interfaceQuestionnaire- Returns:
- value of
idattribute, may benull
-
getRev
public final String getRev()
- Specified by:
getRevin interfaceQuestionnaire- Returns:
- value of
revattribute, may benull
-
getAnswers
public final List<Answer> getAnswers()
- Specified by:
getAnswersin interfaceQuestionnaire- Returns:
- modifiable list
answers
-
getContext
public final List<ContextValue> getContext()
- Specified by:
getContextin interfaceQuestionnaire- Returns:
- modifiable list
context
-
getActiveItem
public final String getActiveItem()
- Specified by:
getActiveItemin interfaceQuestionnaire- Returns:
- value of
activeItemattribute, may benull
-
getErrors
public final List<Error> getErrors()
- Specified by:
getErrorsin interfaceQuestionnaire- Returns:
- modifiable list
errors
-
getVariableValues
public final List<VariableValue> getVariableValues()
- Specified by:
getVariableValuesin interfaceQuestionnaire- Returns:
- modifiable list
variableValues
-
getValueSets
public final List<ValueSet> getValueSets()
- Specified by:
getValueSetsin interfaceQuestionnaire- Returns:
- modifiable list
valueSets
-
getMetadata
public final ModifiableQuestionnaireMetadata getMetadata()
- Specified by:
getMetadatain interfaceQuestionnaire- Returns:
- value of
metadataattribute, may benull
-
clear
public ModifiableQuestionnaire clear()
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
public ModifiableQuestionnaire from(Questionnaire instance)
Fill this modifiable instance with attribute values from the providedQuestionnaireinstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
from
public ModifiableQuestionnaire from(ModifiableQuestionnaire instance)
Fill this modifiable instance with attribute values from the providedQuestionnaireinstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
setId
public ModifiableQuestionnaire setId(String id)
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setRev
public ModifiableQuestionnaire setRev(String rev)
Assigns a value to therevattribute.- Parameters:
rev- The value for rev, can benull- Returns:
thisfor use in a chained invocation
-
addAnswers
public ModifiableQuestionnaire addAnswers(Answer element)
Adds one element toanswerslist.- Parameters:
element- The answers element- Returns:
thisfor use in a chained invocation
-
addAnswers
public final ModifiableQuestionnaire addAnswers(Answer... elements)
Adds elements toanswerslist.- Parameters:
elements- An array of answers elements- Returns:
thisfor use in a chained invocation
-
setAnswers
public ModifiableQuestionnaire setAnswers(Iterable<? extends Answer> elements)
Sets or replaces all elements foranswerslist.- Parameters:
elements- An iterable of answers elements- Returns:
thisfor use in a chained invocation
-
addAllAnswers
public ModifiableQuestionnaire addAllAnswers(Iterable<? extends Answer> elements)
Adds elements toanswerslist.- Parameters:
elements- An iterable of answers elements- Returns:
thisfor use in a chained invocation
-
addContext
public ModifiableQuestionnaire addContext(ContextValue element)
Adds one element tocontextlist.- Parameters:
element- The context element- Returns:
thisfor use in a chained invocation
-
addContext
public final ModifiableQuestionnaire addContext(ContextValue... elements)
Adds elements tocontextlist.- Parameters:
elements- An array of context elements- Returns:
thisfor use in a chained invocation
-
setContext
public ModifiableQuestionnaire setContext(Iterable<? extends ContextValue> elements)
Sets or replaces all elements forcontextlist.- Parameters:
elements- An iterable of context elements- Returns:
thisfor use in a chained invocation
-
addAllContext
public ModifiableQuestionnaire addAllContext(Iterable<? extends ContextValue> elements)
Adds elements tocontextlist.- Parameters:
elements- An iterable of context elements- Returns:
thisfor use in a chained invocation
-
setActiveItem
public ModifiableQuestionnaire setActiveItem(String activeItem)
Assigns a value to theactiveItemattribute.- Parameters:
activeItem- The value for activeItem, can benull- Returns:
thisfor use in a chained invocation
-
addErrors
public ModifiableQuestionnaire addErrors(Error element)
Adds one element toerrorslist.- Parameters:
element- The errors element- Returns:
thisfor use in a chained invocation
-
addErrors
public final ModifiableQuestionnaire addErrors(Error... elements)
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisfor use in a chained invocation
-
setErrors
public ModifiableQuestionnaire setErrors(Iterable<? extends Error> elements)
Sets or replaces all elements forerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisfor use in a chained invocation
-
addAllErrors
public ModifiableQuestionnaire addAllErrors(Iterable<? extends Error> elements)
Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisfor use in a chained invocation
-
addVariableValues
public ModifiableQuestionnaire addVariableValues(VariableValue element)
Adds one element tovariableValueslist.- Parameters:
element- The variableValues element- Returns:
thisfor use in a chained invocation
-
addVariableValues
public final ModifiableQuestionnaire addVariableValues(VariableValue... elements)
Adds elements tovariableValueslist.- Parameters:
elements- An array of variableValues elements- Returns:
thisfor use in a chained invocation
-
setVariableValues
public ModifiableQuestionnaire setVariableValues(Iterable<? extends VariableValue> elements)
Sets or replaces all elements forvariableValueslist.- Parameters:
elements- An iterable of variableValues elements- Returns:
thisfor use in a chained invocation
-
addAllVariableValues
public ModifiableQuestionnaire addAllVariableValues(Iterable<? extends VariableValue> elements)
Adds elements tovariableValueslist.- Parameters:
elements- An iterable of variableValues elements- Returns:
thisfor use in a chained invocation
-
addValueSets
public ModifiableQuestionnaire addValueSets(ValueSet element)
Adds one element tovalueSetslist.- Parameters:
element- The valueSets element- Returns:
thisfor use in a chained invocation
-
addValueSets
public final ModifiableQuestionnaire addValueSets(ValueSet... elements)
Adds elements tovalueSetslist.- Parameters:
elements- An array of valueSets elements- Returns:
thisfor use in a chained invocation
-
setValueSets
public ModifiableQuestionnaire setValueSets(Iterable<? extends ValueSet> elements)
Sets or replaces all elements forvalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisfor use in a chained invocation
-
addAllValueSets
public ModifiableQuestionnaire addAllValueSets(Iterable<? extends ValueSet> elements)
Adds elements tovalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisfor use in a chained invocation
-
setMetadata
public ModifiableQuestionnaire setMetadata(Questionnaire.Metadata metadata)
Assigns a value to themetadataattribute.- Parameters:
metadata- The value for metadata, can benull- Returns:
thisfor use in a chained invocation
-
isInitialized
public final boolean isInitialized()
Returnstrueif all required attributes are set, indicating that the object is initialized.- Returns:
trueif set
-
toImmutable
public final ImmutableQuestionnaire toImmutable()
Converts toImmutableQuestionnaire.- Returns:
- An immutable instance of Questionnaire
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofModifiableQuestionnairethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,rev,answers,context,activeItem,errors,variableValues,valueSets,metadata.
-
-