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 the
Questionnaire type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableQuestionnaire is not thread-safe
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.dialob.api.questionnaire.Questionnaire
Questionnaire.Metadata -
Method Summary
Modifier and TypeMethodDescriptionaddAllAnswers(Iterable<? extends Answer> elements) Adds elements toanswerslist.addAllContext(Iterable<? extends ContextValue> elements) Adds elements tocontextlist.addAllErrors(Iterable<? extends Error> elements) Adds elements toerrorslist.addAllValueSets(Iterable<? extends ValueSet> elements) Adds elements tovalueSetslist.addAllVariableValues(Iterable<? extends VariableValue> elements) Adds elements tovariableValueslist.addAnswers(Answer element) Adds one element toanswerslist.final ModifiableQuestionnaireaddAnswers(Answer... elements) Adds elements toanswerslist.addContext(ContextValue element) Adds one element tocontextlist.final ModifiableQuestionnaireaddContext(ContextValue... elements) Adds elements tocontextlist.Adds one element toerrorslist.final ModifiableQuestionnaireAdds elements toerrorslist.addValueSets(ValueSet element) Adds one element tovalueSetslist.final ModifiableQuestionnaireaddValueSets(ValueSet... elements) Adds elements tovalueSetslist.addVariableValues(VariableValue element) Adds one element tovariableValueslist.final ModifiableQuestionnaireaddVariableValues(VariableValue... elements) Adds elements tovariableValueslist.clear()Clears the object by setting all attributes to their initial values.static ModifiableQuestionnairecreate()Construct a modifiable instance ofQuestionnaire.booleanThis instance is equal to all instances ofModifiableQuestionnairethat have equal attribute values.from(ModifiableQuestionnaire instance) Fill this modifiable instance with attribute values from the providedQuestionnaireinstance.from(Questionnaire instance) Fill this modifiable instance with attribute values from the providedQuestionnaireinstance.final Stringfinal List<ContextValue>final StringgetId()final StringgetRev()final List<VariableValue>inthashCode()Computes a hash code from attributes:id,rev,answers,context,activeItem,errors,variableValues,valueSets,metadata.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.setActiveItem(String activeItem) Assigns a value to theactiveItemattribute.setAnswers(Iterable<? extends Answer> elements) Sets or replaces all elements foranswerslist.setContext(Iterable<? extends ContextValue> elements) Sets or replaces all elements forcontextlist.Sets or replaces all elements forerrorslist.Assigns a value to theidattribute.setMetadata(Questionnaire.Metadata metadata) Assigns a value to themetadataattribute.Assigns a value to therevattribute.setValueSets(Iterable<? extends ValueSet> elements) Sets or replaces all elements forvalueSetslist.setVariableValues(Iterable<? extends VariableValue> elements) Sets or replaces all elements forvariableValueslist.final ImmutableQuestionnaireConverts toImmutableQuestionnaire.toString()Generates a string representation of thisQuestionnaire.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.dialob.api.validation.WithValidation
validate
-
Method Details
-
create
Construct a modifiable instance ofQuestionnaire.- Returns:
- A new modifiable instance
-
getId
- Specified by:
getIdin interfaceQuestionnaire- Returns:
- value of
idattribute, may benull
-
getRev
- Specified by:
getRevin interfaceQuestionnaire- Returns:
- value of
revattribute, may benull
-
getAnswers
- Specified by:
getAnswersin interfaceQuestionnaire- Returns:
- modifiable list
answers
-
getContext
- Specified by:
getContextin interfaceQuestionnaire- Returns:
- modifiable list
context
-
getActiveItem
- Specified by:
getActiveItemin interfaceQuestionnaire- Returns:
- value of
activeItemattribute, may benull
-
getErrors
- Specified by:
getErrorsin interfaceQuestionnaire- Returns:
- modifiable list
errors
-
getVariableValues
- Specified by:
getVariableValuesin interfaceQuestionnaire- Returns:
- modifiable list
variableValues
-
getValueSets
- Specified by:
getValueSetsin interfaceQuestionnaire- Returns:
- modifiable list
valueSets
-
getMetadata
- Specified by:
getMetadatain interfaceQuestionnaire- Returns:
- value of
metadataattribute, may benull
-
clear
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
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
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
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setRev
Assigns a value to therevattribute.- Parameters:
rev- The value for rev, can benull- Returns:
thisfor use in a chained invocation
-
addAnswers
Adds one element toanswerslist.- Parameters:
element- The answers element- Returns:
thisfor use in a chained invocation
-
addAnswers
Adds elements toanswerslist.- Parameters:
elements- An array of answers elements- Returns:
thisfor use in a chained invocation
-
setAnswers
Sets or replaces all elements foranswerslist.- Parameters:
elements- An iterable of answers elements- Returns:
thisfor use in a chained invocation
-
addAllAnswers
Adds elements toanswerslist.- Parameters:
elements- An iterable of answers elements- Returns:
thisfor use in a chained invocation
-
addContext
Adds one element tocontextlist.- Parameters:
element- The context element- Returns:
thisfor use in a chained invocation
-
addContext
Adds elements tocontextlist.- Parameters:
elements- An array of context elements- Returns:
thisfor use in a chained invocation
-
setContext
Sets or replaces all elements forcontextlist.- Parameters:
elements- An iterable of context elements- Returns:
thisfor use in a chained invocation
-
addAllContext
Adds elements tocontextlist.- Parameters:
elements- An iterable of context elements- Returns:
thisfor use in a chained invocation
-
setActiveItem
Assigns a value to theactiveItemattribute.- Parameters:
activeItem- The value for activeItem, can benull- Returns:
thisfor use in a chained invocation
-
addErrors
Adds one element toerrorslist.- Parameters:
element- The errors element- Returns:
thisfor use in a chained invocation
-
addErrors
Adds elements toerrorslist.- Parameters:
elements- An array of errors elements- Returns:
thisfor use in a chained invocation
-
setErrors
Sets or replaces all elements forerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisfor use in a chained invocation
-
addAllErrors
Adds elements toerrorslist.- Parameters:
elements- An iterable of errors elements- Returns:
thisfor use in a chained invocation
-
addVariableValues
Adds one element tovariableValueslist.- Parameters:
element- The variableValues element- Returns:
thisfor use in a chained invocation
-
addVariableValues
Adds elements tovariableValueslist.- Parameters:
elements- An array of variableValues elements- Returns:
thisfor use in a chained invocation
-
setVariableValues
Sets or replaces all elements forvariableValueslist.- Parameters:
elements- An iterable of variableValues elements- Returns:
thisfor use in a chained invocation
-
addAllVariableValues
Adds elements tovariableValueslist.- Parameters:
elements- An iterable of variableValues elements- Returns:
thisfor use in a chained invocation
-
addValueSets
Adds one element tovalueSetslist.- Parameters:
element- The valueSets element- Returns:
thisfor use in a chained invocation
-
addValueSets
Adds elements tovalueSetslist.- Parameters:
elements- An array of valueSets elements- Returns:
thisfor use in a chained invocation
-
setValueSets
Sets or replaces all elements forvalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisfor use in a chained invocation
-
addAllValueSets
Adds elements tovalueSetslist.- Parameters:
elements- An iterable of valueSets elements- Returns:
thisfor use in a chained invocation
-
setMetadata
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
Converts toImmutableQuestionnaire.- Returns:
- An immutable instance of Questionnaire
-
equals
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. -
toString
Generates a string representation of thisQuestionnaire. If uninitialized, some attribute values may appear as question marks.
-