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 ofQuestionnaire.Use the builder to create immutable instances:
ImmutableQuestionnaire.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableQuestionnaire.BuilderBuilds instances of typeImmutableQuestionnaire.-
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 static ImmutableQuestionnaire.Builderbuilder()Creates a builder forImmutableQuestionnaire.static ImmutableQuestionnairecopyOf(Questionnaire instance)Creates an immutable copy of aQuestionnairevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableQuestionnairethat have equal attribute values.StringgetActiveItem()List<Answer>getAnswers()List<ContextValue>getContext()List<Error>getErrors()StringgetId()ImmutableQuestionnaireMetadatagetMetadata()StringgetRev()List<ValueSet>getValueSets()List<VariableValue>getVariableValues()inthashCode()Computes a hash code from attributes:id,rev,answers,context,activeItem,errors,variableValues,valueSets,metadata.StringtoString()Prints the immutable valueQuestionnairewith attribute values.ImmutableQuestionnairewithActiveItem(String value)Copy the current immutable object by setting a value for theactiveItemattribute.ImmutableQuestionnairewithAnswers(Answer... elements)Copy the current immutable object with elements that replace the content ofanswers.ImmutableQuestionnairewithAnswers(Iterable<? extends Answer> elements)Copy the current immutable object with elements that replace the content ofanswers.ImmutableQuestionnairewithContext(ContextValue... elements)Copy the current immutable object with elements that replace the content ofcontext.ImmutableQuestionnairewithContext(Iterable<? extends ContextValue> elements)Copy the current immutable object with elements that replace the content ofcontext.ImmutableQuestionnairewithErrors(Error... elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableQuestionnairewithErrors(Iterable<? extends Error> elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableQuestionnairewithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableQuestionnairewithMetadata(Questionnaire.Metadata value)Copy the current immutable object by setting a value for themetadataattribute.ImmutableQuestionnairewithRev(String value)Copy the current immutable object by setting a value for therevattribute.ImmutableQuestionnairewithValueSets(ValueSet... elements)Copy the current immutable object with elements that replace the content ofvalueSets.ImmutableQuestionnairewithValueSets(Iterable<? extends ValueSet> elements)Copy the current immutable object with elements that replace the content ofvalueSets.ImmutableQuestionnairewithVariableValues(VariableValue... elements)Copy the current immutable object with elements that replace the content ofvariableValues.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, wait
-
Methods inherited from interface io.dialob.api.validation.WithValidation
validate
-
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceQuestionnaire- Returns:
- The value of the
idattribute
-
getRev
public String getRev()
- Specified by:
getRevin interfaceQuestionnaire- Returns:
- The value of the
revattribute
-
getAnswers
public List<Answer> getAnswers()
- Specified by:
getAnswersin interfaceQuestionnaire- Returns:
- The value of the
answersattribute
-
getContext
public List<ContextValue> getContext()
- Specified by:
getContextin interfaceQuestionnaire- Returns:
- The value of the
contextattribute
-
getActiveItem
public String getActiveItem()
- Specified by:
getActiveItemin interfaceQuestionnaire- Returns:
- The value of the
activeItemattribute
-
getErrors
public List<Error> getErrors()
- Specified by:
getErrorsin interfaceQuestionnaire- Returns:
- The value of the
errorsattribute
-
getVariableValues
public List<VariableValue> getVariableValues()
- Specified by:
getVariableValuesin interfaceQuestionnaire- Returns:
- The value of the
variableValuesattribute
-
getValueSets
public List<ValueSet> getValueSets()
- Specified by:
getValueSetsin interfaceQuestionnaire- Returns:
- The value of the
valueSetsattribute
-
getMetadata
public ImmutableQuestionnaireMetadata getMetadata()
- Specified by:
getMetadatain interfaceQuestionnaire- Returns:
- The value of the
metadataattribute
-
withId
public final ImmutableQuestionnaire withId(String value)
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
public final ImmutableQuestionnaire withRev(String value)
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
public final ImmutableQuestionnaire withAnswers(Answer... elements)
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
public final ImmutableQuestionnaire withAnswers(Iterable<? extends Answer> elements)
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
public final ImmutableQuestionnaire withContext(ContextValue... elements)
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
public final ImmutableQuestionnaire withContext(Iterable<? extends ContextValue> elements)
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
public final ImmutableQuestionnaire withActiveItem(String value)
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
public final ImmutableQuestionnaire withErrors(Error... elements)
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
public final ImmutableQuestionnaire withErrors(Iterable<? extends Error> elements)
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
public final ImmutableQuestionnaire withVariableValues(VariableValue... elements)
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
public final ImmutableQuestionnaire withVariableValues(Iterable<? extends VariableValue> elements)
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
public final ImmutableQuestionnaire withValueSets(ValueSet... elements)
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
public final ImmutableQuestionnaire withValueSets(Iterable<? extends ValueSet> elements)
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
public final ImmutableQuestionnaire withMetadata(Questionnaire.Metadata value)
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
public boolean equals(@Nullable Object another)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
public String toString()
Prints the immutable valueQuestionnairewith attribute values.
-
copyOf
public static ImmutableQuestionnaire copyOf(Questionnaire instance)
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
public static ImmutableQuestionnaire.Builder 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
-
-