Package io.dialob.api.questionnaire
Class ImmutableQuestionnaire
java.lang.Object
io.dialob.api.questionnaire.ImmutableQuestionnaire
- All Implemented Interfaces:
Questionnaire,WithValidation<Questionnaire>,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableQuestionnaire
extends Object
implements Questionnaire
Immutable implementation of
Questionnaire.
Use the builder to create immutable instances:
ImmutableQuestionnaire.builder().
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableQuestionnaire.Nested classes/interfaces inherited from interface io.dialob.api.questionnaire.Questionnaire
Questionnaire.Metadata -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableQuestionnaire.static ImmutableQuestionnairecopyOf(Questionnaire instance) Creates an immutable copy of aQuestionnairevalue.booleanThis instance is equal to all instances ofImmutableQuestionnairethat have equal attribute values.getId()getRev()inthashCode()Computes a hash code from attributes:id,rev,answers,context,activeItem,errors,variableValues,valueSets,metadata.toString()Prints the immutable valueQuestionnairewith attribute values.final ImmutableQuestionnairewithActiveItem(String value) Copy the current immutable object by setting a value for theactiveItemattribute.final ImmutableQuestionnairewithAnswers(Answer... elements) Copy the current immutable object with elements that replace the content ofanswers.final ImmutableQuestionnairewithAnswers(Iterable<? extends Answer> elements) Copy the current immutable object with elements that replace the content ofanswers.final ImmutableQuestionnairewithContext(ContextValue... elements) Copy the current immutable object with elements that replace the content ofcontext.final ImmutableQuestionnairewithContext(Iterable<? extends ContextValue> elements) Copy the current immutable object with elements that replace the content ofcontext.final ImmutableQuestionnairewithErrors(Error... elements) Copy the current immutable object with elements that replace the content oferrors.final ImmutableQuestionnairewithErrors(Iterable<? extends Error> elements) Copy the current immutable object with elements that replace the content oferrors.final ImmutableQuestionnaireCopy the current immutable object by setting a value for theidattribute.final ImmutableQuestionnaireCopy the current immutable object by setting a value for themetadataattribute.final ImmutableQuestionnaireCopy the current immutable object by setting a value for therevattribute.final ImmutableQuestionnairewithValueSets(ValueSet... elements) Copy the current immutable object with elements that replace the content ofvalueSets.final ImmutableQuestionnairewithValueSets(Iterable<? extends ValueSet> elements) Copy the current immutable object with elements that replace the content ofvalueSets.final ImmutableQuestionnairewithVariableValues(VariableValue... elements) Copy the current immutable object with elements that replace the content ofvariableValues.final ImmutableQuestionnairewithVariableValues(Iterable<? extends VariableValue> elements) Copy the current immutable object with elements that replace the content ofvariableValues.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
-
getId
- Specified by:
getIdin interfaceQuestionnaire- Returns:
- The value of the
idattribute
-
getRev
- Specified by:
getRevin interfaceQuestionnaire- Returns:
- The value of the
revattribute
-
getAnswers
- Specified by:
getAnswersin interfaceQuestionnaire- Returns:
- The value of the
answersattribute
-
getContext
- Specified by:
getContextin interfaceQuestionnaire- Returns:
- The value of the
contextattribute
-
getActiveItem
- Specified by:
getActiveItemin interfaceQuestionnaire- Returns:
- The value of the
activeItemattribute
-
getErrors
- Specified by:
getErrorsin interfaceQuestionnaire- Returns:
- The value of the
errorsattribute
-
getVariableValues
- Specified by:
getVariableValuesin interfaceQuestionnaire- Returns:
- The value of the
variableValuesattribute
-
getValueSets
- Specified by:
getValueSetsin interfaceQuestionnaire- Returns:
- The value of the
valueSetsattribute
-
getMetadata
- Specified by:
getMetadatain interfaceQuestionnaire- Returns:
- The value of the
metadataattribute
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withRev
Copy the current immutable object by setting a value for therevattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for rev (can benull)- Returns:
- A modified copy of the
thisobject
-
withAnswers
Copy the current immutable object with elements that replace the content ofanswers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAnswers
Copy the current immutable object with elements that replace the content ofanswers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of answers elements to set- Returns:
- A modified copy of
thisobject
-
withContext
Copy the current immutable object with elements that replace the content ofcontext.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withContext
Copy the current immutable object with elements that replace the content ofcontext. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of context elements to set- Returns:
- A modified copy of
thisobject
-
withActiveItem
Copy the current immutable object by setting a value for theactiveItemattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for activeItem (can benull)- Returns:
- A modified copy of the
thisobject
-
withErrors
Copy the current immutable object with elements that replace the content oferrors.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
Copy the current immutable object with elements that replace the content oferrors. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of errors elements to set- Returns:
- A modified copy of
thisobject
-
withVariableValues
Copy the current immutable object with elements that replace the content ofvariableValues.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withVariableValues
Copy the current immutable object with elements that replace the content ofvariableValues. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of variableValues elements to set- Returns:
- A modified copy of
thisobject
-
withValueSets
Copy the current immutable object with elements that replace the content ofvalueSets.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withValueSets
Copy the current immutable object with elements that replace the content ofvalueSets. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of valueSets elements to set- Returns:
- A modified copy of
thisobject
-
withMetadata
Copy the current immutable object by setting a value for themetadataattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for metadata (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableQuestionnairethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,rev,answers,context,activeItem,errors,variableValues,valueSets,metadata. -
toString
Prints the immutable valueQuestionnairewith attribute values. -
copyOf
Creates an immutable copy of aQuestionnairevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Questionnaire instance
-
builder
Creates a builder forImmutableQuestionnaire.ImmutableQuestionnaire.builder() .id(String | null) // nullableid.rev(String | null) // nullablerev.addAnswers|addAllAnswers(io.dialob.api.questionnaire.Answer) //answerselements .addContext|addAllContext(io.dialob.api.questionnaire.ContextValue) //contextelements .activeItem(String | null) // nullableactiveItem.addErrors|addAllErrors(io.dialob.api.questionnaire.Error) //errorselements .addVariableValues|addAllVariableValues(io.dialob.api.questionnaire.VariableValue) //variableValueselements .addValueSets|addAllValueSets(io.dialob.api.proto.ValueSet) //valueSetselements .metadata(io.dialob.api.questionnaire.Questionnaire.Metadata | null) // nullablemetadata.build();- Returns:
- A new ImmutableQuestionnaire builder
-