All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.wellarchitected.model.ReviewTemplateAnswerSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Well Architected module holds the client classes that are used for communicating with Well Architected.

There is a newer version: 2.29.15
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.wellarchitected.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The summary of review template answers. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReviewTemplateAnswerSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField QUESTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("QuestionId").getter(getter(ReviewTemplateAnswerSummary::questionId)).setter(setter(Builder::questionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuestionId").build()).build(); private static final SdkField PILLAR_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("PillarId").getter(getter(ReviewTemplateAnswerSummary::pillarId)).setter(setter(Builder::pillarId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PillarId").build()).build(); private static final SdkField QUESTION_TITLE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("QuestionTitle").getter(getter(ReviewTemplateAnswerSummary::questionTitle)) .setter(setter(Builder::questionTitle)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuestionTitle").build()).build(); private static final SdkField> CHOICES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Choices") .getter(getter(ReviewTemplateAnswerSummary::choices)) .setter(setter(Builder::choices)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Choices").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Choice::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> SELECTED_CHOICES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("SelectedChoices") .getter(getter(ReviewTemplateAnswerSummary::selectedChoices)) .setter(setter(Builder::selectedChoices)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelectedChoices").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> CHOICE_ANSWER_SUMMARIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ChoiceAnswerSummaries") .getter(getter(ReviewTemplateAnswerSummary::choiceAnswerSummaries)) .setter(setter(Builder::choiceAnswerSummaries)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChoiceAnswerSummaries").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ChoiceAnswerSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField IS_APPLICABLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("IsApplicable").getter(getter(ReviewTemplateAnswerSummary::isApplicable)) .setter(setter(Builder::isApplicable)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsApplicable").build()).build(); private static final SdkField ANSWER_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AnswerStatus").getter(getter(ReviewTemplateAnswerSummary::answerStatusAsString)) .setter(setter(Builder::answerStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnswerStatus").build()).build(); private static final SdkField REASON_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Reason") .getter(getter(ReviewTemplateAnswerSummary::reasonAsString)).setter(setter(Builder::reason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Reason").build()).build(); private static final SdkField QUESTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("QuestionType").getter(getter(ReviewTemplateAnswerSummary::questionTypeAsString)) .setter(setter(Builder::questionType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuestionType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(QUESTION_ID_FIELD, PILLAR_ID_FIELD, QUESTION_TITLE_FIELD, CHOICES_FIELD, SELECTED_CHOICES_FIELD, CHOICE_ANSWER_SUMMARIES_FIELD, IS_APPLICABLE_FIELD, ANSWER_STATUS_FIELD, REASON_FIELD, QUESTION_TYPE_FIELD)); private static final long serialVersionUID = 1L; private final String questionId; private final String pillarId; private final String questionTitle; private final List choices; private final List selectedChoices; private final List choiceAnswerSummaries; private final Boolean isApplicable; private final String answerStatus; private final String reason; private final String questionType; private ReviewTemplateAnswerSummary(BuilderImpl builder) { this.questionId = builder.questionId; this.pillarId = builder.pillarId; this.questionTitle = builder.questionTitle; this.choices = builder.choices; this.selectedChoices = builder.selectedChoices; this.choiceAnswerSummaries = builder.choiceAnswerSummaries; this.isApplicable = builder.isApplicable; this.answerStatus = builder.answerStatus; this.reason = builder.reason; this.questionType = builder.questionType; } /** * Returns the value of the QuestionId property for this object. * * @return The value of the QuestionId property for this object. */ public final String questionId() { return questionId; } /** * Returns the value of the PillarId property for this object. * * @return The value of the PillarId property for this object. */ public final String pillarId() { return pillarId; } /** * Returns the value of the QuestionTitle property for this object. * * @return The value of the QuestionTitle property for this object. */ public final String questionTitle() { return questionTitle; } /** * For responses, this returns true if the service returned a value for the Choices property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasChoices() { return choices != null && !(choices instanceof SdkAutoConstructList); } /** * Returns the value of the Choices property for this object. *

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasChoices} method. *

* * @return The value of the Choices property for this object. */ public final List choices() { return choices; } /** * For responses, this returns true if the service returned a value for the SelectedChoices property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasSelectedChoices() { return selectedChoices != null && !(selectedChoices instanceof SdkAutoConstructList); } /** * Returns the value of the SelectedChoices property for this object. *

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSelectedChoices} method. *

* * @return The value of the SelectedChoices property for this object. */ public final List selectedChoices() { return selectedChoices; } /** * For responses, this returns true if the service returned a value for the ChoiceAnswerSummaries property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasChoiceAnswerSummaries() { return choiceAnswerSummaries != null && !(choiceAnswerSummaries instanceof SdkAutoConstructList); } /** *

* A list of selected choices to a question in the review template. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasChoiceAnswerSummaries} method. *

* * @return A list of selected choices to a question in the review template. */ public final List choiceAnswerSummaries() { return choiceAnswerSummaries; } /** * Returns the value of the IsApplicable property for this object. * * @return The value of the IsApplicable property for this object. */ public final Boolean isApplicable() { return isApplicable; } /** *

* The status of whether or not this question has been answered. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #answerStatus} will * return {@link ReviewTemplateAnswerStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #answerStatusAsString}. *

* * @return The status of whether or not this question has been answered. * @see ReviewTemplateAnswerStatus */ public final ReviewTemplateAnswerStatus answerStatus() { return ReviewTemplateAnswerStatus.fromValue(answerStatus); } /** *

* The status of whether or not this question has been answered. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #answerStatus} will * return {@link ReviewTemplateAnswerStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #answerStatusAsString}. *

* * @return The status of whether or not this question has been answered. * @see ReviewTemplateAnswerStatus */ public final String answerStatusAsString() { return answerStatus; } /** *

* The reason why a choice is not-applicable to a question in the review template. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #reason} will * return {@link AnswerReason#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #reasonAsString}. *

* * @return The reason why a choice is not-applicable to a question in the review template. * @see AnswerReason */ public final AnswerReason reason() { return AnswerReason.fromValue(reason); } /** *

* The reason why a choice is not-applicable to a question in the review template. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #reason} will * return {@link AnswerReason#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #reasonAsString}. *

* * @return The reason why a choice is not-applicable to a question in the review template. * @see AnswerReason */ public final String reasonAsString() { return reason; } /** *

* The type of question. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #questionType} will * return {@link QuestionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #questionTypeAsString}. *

* * @return The type of question. * @see QuestionType */ public final QuestionType questionType() { return QuestionType.fromValue(questionType); } /** *

* The type of question. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #questionType} will * return {@link QuestionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #questionTypeAsString}. *

* * @return The type of question. * @see QuestionType */ public final String questionTypeAsString() { return questionType; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(questionId()); hashCode = 31 * hashCode + Objects.hashCode(pillarId()); hashCode = 31 * hashCode + Objects.hashCode(questionTitle()); hashCode = 31 * hashCode + Objects.hashCode(hasChoices() ? choices() : null); hashCode = 31 * hashCode + Objects.hashCode(hasSelectedChoices() ? selectedChoices() : null); hashCode = 31 * hashCode + Objects.hashCode(hasChoiceAnswerSummaries() ? choiceAnswerSummaries() : null); hashCode = 31 * hashCode + Objects.hashCode(isApplicable()); hashCode = 31 * hashCode + Objects.hashCode(answerStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(reasonAsString()); hashCode = 31 * hashCode + Objects.hashCode(questionTypeAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ReviewTemplateAnswerSummary)) { return false; } ReviewTemplateAnswerSummary other = (ReviewTemplateAnswerSummary) obj; return Objects.equals(questionId(), other.questionId()) && Objects.equals(pillarId(), other.pillarId()) && Objects.equals(questionTitle(), other.questionTitle()) && hasChoices() == other.hasChoices() && Objects.equals(choices(), other.choices()) && hasSelectedChoices() == other.hasSelectedChoices() && Objects.equals(selectedChoices(), other.selectedChoices()) && hasChoiceAnswerSummaries() == other.hasChoiceAnswerSummaries() && Objects.equals(choiceAnswerSummaries(), other.choiceAnswerSummaries()) && Objects.equals(isApplicable(), other.isApplicable()) && Objects.equals(answerStatusAsString(), other.answerStatusAsString()) && Objects.equals(reasonAsString(), other.reasonAsString()) && Objects.equals(questionTypeAsString(), other.questionTypeAsString()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("ReviewTemplateAnswerSummary").add("QuestionId", questionId()).add("PillarId", pillarId()) .add("QuestionTitle", questionTitle()).add("Choices", hasChoices() ? choices() : null) .add("SelectedChoices", hasSelectedChoices() ? selectedChoices() : null) .add("ChoiceAnswerSummaries", hasChoiceAnswerSummaries() ? choiceAnswerSummaries() : null) .add("IsApplicable", isApplicable()).add("AnswerStatus", answerStatusAsString()).add("Reason", reasonAsString()) .add("QuestionType", questionTypeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "QuestionId": return Optional.ofNullable(clazz.cast(questionId())); case "PillarId": return Optional.ofNullable(clazz.cast(pillarId())); case "QuestionTitle": return Optional.ofNullable(clazz.cast(questionTitle())); case "Choices": return Optional.ofNullable(clazz.cast(choices())); case "SelectedChoices": return Optional.ofNullable(clazz.cast(selectedChoices())); case "ChoiceAnswerSummaries": return Optional.ofNullable(clazz.cast(choiceAnswerSummaries())); case "IsApplicable": return Optional.ofNullable(clazz.cast(isApplicable())); case "AnswerStatus": return Optional.ofNullable(clazz.cast(answerStatusAsString())); case "Reason": return Optional.ofNullable(clazz.cast(reasonAsString())); case "QuestionType": return Optional.ofNullable(clazz.cast(questionTypeAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReviewTemplateAnswerSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** * Sets the value of the QuestionId property for this object. * * @param questionId * The new value for the QuestionId property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder questionId(String questionId); /** * Sets the value of the PillarId property for this object. * * @param pillarId * The new value for the PillarId property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pillarId(String pillarId); /** * Sets the value of the QuestionTitle property for this object. * * @param questionTitle * The new value for the QuestionTitle property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder questionTitle(String questionTitle); /** * Sets the value of the Choices property for this object. * * @param choices * The new value for the Choices property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder choices(Collection choices); /** * Sets the value of the Choices property for this object. * * @param choices * The new value for the Choices property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder choices(Choice... choices); /** * Sets the value of the Choices property for this object. * * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.wellarchitected.model.Choice.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.wellarchitected.model.Choice#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.wellarchitected.model.Choice.Builder#build()} is called immediately * and its result is passed to {@link #choices(List)}. * * @param choices * a consumer that will call methods on * {@link software.amazon.awssdk.services.wellarchitected.model.Choice.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #choices(java.util.Collection) */ Builder choices(Consumer... choices); /** * Sets the value of the SelectedChoices property for this object. * * @param selectedChoices * The new value for the SelectedChoices property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder selectedChoices(Collection selectedChoices); /** * Sets the value of the SelectedChoices property for this object. * * @param selectedChoices * The new value for the SelectedChoices property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder selectedChoices(String... selectedChoices); /** *

* A list of selected choices to a question in the review template. *

* * @param choiceAnswerSummaries * A list of selected choices to a question in the review template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder choiceAnswerSummaries(Collection choiceAnswerSummaries); /** *

* A list of selected choices to a question in the review template. *

* * @param choiceAnswerSummaries * A list of selected choices to a question in the review template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder choiceAnswerSummaries(ChoiceAnswerSummary... choiceAnswerSummaries); /** *

* A list of selected choices to a question in the review template. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.wellarchitected.model.ChoiceAnswerSummary.Builder} avoiding the need * to create one manually via * {@link software.amazon.awssdk.services.wellarchitected.model.ChoiceAnswerSummary#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.wellarchitected.model.ChoiceAnswerSummary.Builder#build()} is called * immediately and its result is passed to {@link #choiceAnswerSummaries(List)}. * * @param choiceAnswerSummaries * a consumer that will call methods on * {@link software.amazon.awssdk.services.wellarchitected.model.ChoiceAnswerSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #choiceAnswerSummaries(java.util.Collection) */ Builder choiceAnswerSummaries(Consumer... choiceAnswerSummaries); /** * Sets the value of the IsApplicable property for this object. * * @param isApplicable * The new value for the IsApplicable property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isApplicable(Boolean isApplicable); /** *

* The status of whether or not this question has been answered. *

* * @param answerStatus * The status of whether or not this question has been answered. * @see ReviewTemplateAnswerStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ReviewTemplateAnswerStatus */ Builder answerStatus(String answerStatus); /** *

* The status of whether or not this question has been answered. *

* * @param answerStatus * The status of whether or not this question has been answered. * @see ReviewTemplateAnswerStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ReviewTemplateAnswerStatus */ Builder answerStatus(ReviewTemplateAnswerStatus answerStatus); /** *

* The reason why a choice is not-applicable to a question in the review template. *

* * @param reason * The reason why a choice is not-applicable to a question in the review template. * @see AnswerReason * @return Returns a reference to this object so that method calls can be chained together. * @see AnswerReason */ Builder reason(String reason); /** *

* The reason why a choice is not-applicable to a question in the review template. *

* * @param reason * The reason why a choice is not-applicable to a question in the review template. * @see AnswerReason * @return Returns a reference to this object so that method calls can be chained together. * @see AnswerReason */ Builder reason(AnswerReason reason); /** *

* The type of question. *

* * @param questionType * The type of question. * @see QuestionType * @return Returns a reference to this object so that method calls can be chained together. * @see QuestionType */ Builder questionType(String questionType); /** *

* The type of question. *

* * @param questionType * The type of question. * @see QuestionType * @return Returns a reference to this object so that method calls can be chained together. * @see QuestionType */ Builder questionType(QuestionType questionType); } static final class BuilderImpl implements Builder { private String questionId; private String pillarId; private String questionTitle; private List choices = DefaultSdkAutoConstructList.getInstance(); private List selectedChoices = DefaultSdkAutoConstructList.getInstance(); private List choiceAnswerSummaries = DefaultSdkAutoConstructList.getInstance(); private Boolean isApplicable; private String answerStatus; private String reason; private String questionType; private BuilderImpl() { } private BuilderImpl(ReviewTemplateAnswerSummary model) { questionId(model.questionId); pillarId(model.pillarId); questionTitle(model.questionTitle); choices(model.choices); selectedChoices(model.selectedChoices); choiceAnswerSummaries(model.choiceAnswerSummaries); isApplicable(model.isApplicable); answerStatus(model.answerStatus); reason(model.reason); questionType(model.questionType); } public final String getQuestionId() { return questionId; } public final void setQuestionId(String questionId) { this.questionId = questionId; } @Override public final Builder questionId(String questionId) { this.questionId = questionId; return this; } public final String getPillarId() { return pillarId; } public final void setPillarId(String pillarId) { this.pillarId = pillarId; } @Override public final Builder pillarId(String pillarId) { this.pillarId = pillarId; return this; } public final String getQuestionTitle() { return questionTitle; } public final void setQuestionTitle(String questionTitle) { this.questionTitle = questionTitle; } @Override public final Builder questionTitle(String questionTitle) { this.questionTitle = questionTitle; return this; } public final List getChoices() { List result = ChoicesCopier.copyToBuilder(this.choices); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setChoices(Collection choices) { this.choices = ChoicesCopier.copyFromBuilder(choices); } @Override public final Builder choices(Collection choices) { this.choices = ChoicesCopier.copy(choices); return this; } @Override @SafeVarargs public final Builder choices(Choice... choices) { choices(Arrays.asList(choices)); return this; } @Override @SafeVarargs public final Builder choices(Consumer... choices) { choices(Stream.of(choices).map(c -> Choice.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Collection getSelectedChoices() { if (selectedChoices instanceof SdkAutoConstructList) { return null; } return selectedChoices; } public final void setSelectedChoices(Collection selectedChoices) { this.selectedChoices = SelectedChoicesCopier.copy(selectedChoices); } @Override public final Builder selectedChoices(Collection selectedChoices) { this.selectedChoices = SelectedChoicesCopier.copy(selectedChoices); return this; } @Override @SafeVarargs public final Builder selectedChoices(String... selectedChoices) { selectedChoices(Arrays.asList(selectedChoices)); return this; } public final List getChoiceAnswerSummaries() { List result = ChoiceAnswerSummariesCopier.copyToBuilder(this.choiceAnswerSummaries); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setChoiceAnswerSummaries(Collection choiceAnswerSummaries) { this.choiceAnswerSummaries = ChoiceAnswerSummariesCopier.copyFromBuilder(choiceAnswerSummaries); } @Override public final Builder choiceAnswerSummaries(Collection choiceAnswerSummaries) { this.choiceAnswerSummaries = ChoiceAnswerSummariesCopier.copy(choiceAnswerSummaries); return this; } @Override @SafeVarargs public final Builder choiceAnswerSummaries(ChoiceAnswerSummary... choiceAnswerSummaries) { choiceAnswerSummaries(Arrays.asList(choiceAnswerSummaries)); return this; } @Override @SafeVarargs public final Builder choiceAnswerSummaries(Consumer... choiceAnswerSummaries) { choiceAnswerSummaries(Stream.of(choiceAnswerSummaries) .map(c -> ChoiceAnswerSummary.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Boolean getIsApplicable() { return isApplicable; } public final void setIsApplicable(Boolean isApplicable) { this.isApplicable = isApplicable; } @Override public final Builder isApplicable(Boolean isApplicable) { this.isApplicable = isApplicable; return this; } public final String getAnswerStatus() { return answerStatus; } public final void setAnswerStatus(String answerStatus) { this.answerStatus = answerStatus; } @Override public final Builder answerStatus(String answerStatus) { this.answerStatus = answerStatus; return this; } @Override public final Builder answerStatus(ReviewTemplateAnswerStatus answerStatus) { this.answerStatus(answerStatus == null ? null : answerStatus.toString()); return this; } public final String getReason() { return reason; } public final void setReason(String reason) { this.reason = reason; } @Override public final Builder reason(String reason) { this.reason = reason; return this; } @Override public final Builder reason(AnswerReason reason) { this.reason(reason == null ? null : reason.toString()); return this; } public final String getQuestionType() { return questionType; } public final void setQuestionType(String questionType) { this.questionType = questionType; } @Override public final Builder questionType(String questionType) { this.questionType = questionType; return this; } @Override public final Builder questionType(QuestionType questionType) { this.questionType(questionType == null ? null : questionType.toString()); return this; } @Override public ReviewTemplateAnswerSummary build() { return new ReviewTemplateAnswerSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy