Class ImmutableQuestionnaire

    • Method Detail

      • withId

        public final ImmutableQuestionnaire withId​(String value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withRev

        public final ImmutableQuestionnaire withRev​(String value)
        Copy the current immutable object by setting a value for the rev attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for rev (can be null)
        Returns:
        A modified copy of the this object
      • withAnswers

        public final ImmutableQuestionnaire withAnswers​(Answer... elements)
        Copy the current immutable object with elements that replace the content of answers.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withAnswers

        public final ImmutableQuestionnaire withAnswers​(Iterable<? extends Answer> elements)
        Copy the current immutable object with elements that replace the content of answers. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of answers elements to set
        Returns:
        A modified copy of this object
      • withContext

        public final ImmutableQuestionnaire withContext​(ContextValue... elements)
        Copy the current immutable object with elements that replace the content of context.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withContext

        public final ImmutableQuestionnaire withContext​(Iterable<? extends ContextValue> elements)
        Copy the current immutable object with elements that replace the content of context. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of context elements to set
        Returns:
        A modified copy of this object
      • withActiveItem

        public final ImmutableQuestionnaire withActiveItem​(String value)
        Copy the current immutable object by setting a value for the activeItem attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for activeItem (can be null)
        Returns:
        A modified copy of the this object
      • withErrors

        public final ImmutableQuestionnaire withErrors​(Error... elements)
        Copy the current immutable object with elements that replace the content of errors.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withErrors

        public final ImmutableQuestionnaire withErrors​(Iterable<? extends Error> elements)
        Copy the current immutable object with elements that replace the content of errors. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of errors elements to set
        Returns:
        A modified copy of this object
      • withVariableValues

        public final ImmutableQuestionnaire withVariableValues​(VariableValue... elements)
        Copy the current immutable object with elements that replace the content of variableValues.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withVariableValues

        public final ImmutableQuestionnaire withVariableValues​(Iterable<? extends VariableValue> elements)
        Copy the current immutable object with elements that replace the content of variableValues. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of variableValues elements to set
        Returns:
        A modified copy of this object
      • withValueSets

        public final ImmutableQuestionnaire withValueSets​(ValueSet... elements)
        Copy the current immutable object with elements that replace the content of valueSets.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withValueSets

        public final ImmutableQuestionnaire withValueSets​(Iterable<? extends ValueSet> elements)
        Copy the current immutable object with elements that replace the content of valueSets. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of valueSets elements to set
        Returns:
        A modified copy of this object
      • withMetadata

        public final ImmutableQuestionnaire withMetadata​(Questionnaire.Metadata value)
        Copy the current immutable object by setting a value for the metadata attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for metadata (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableQuestionnaire that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: id, rev, answers, context, activeItem, errors, variableValues, valueSets, metadata.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value Questionnaire with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableQuestionnaire copyOf​(Questionnaire instance)
        Creates an immutable copy of a Questionnaire value. 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 for ImmutableQuestionnaire.
         ImmutableQuestionnaire.builder()
            .id(String | null) // nullable id
            .rev(String | null) // nullable rev
            .addAnswers|addAllAnswers(io.dialob.api.questionnaire.Answer) // answers elements
            .addContext|addAllContext(io.dialob.api.questionnaire.ContextValue) // context elements
            .activeItem(String | null) // nullable activeItem
            .addErrors|addAllErrors(io.dialob.api.questionnaire.Error) // errors elements
            .addVariableValues|addAllVariableValues(io.dialob.api.questionnaire.VariableValue) // variableValues elements
            .addValueSets|addAllValueSets(io.dialob.api.proto.ValueSet) // valueSets elements
            .metadata(io.dialob.api.questionnaire.Questionnaire.Metadata | null) // nullable metadata
            .build();
         
        Returns:
        A new ImmutableQuestionnaire builder