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

software.amazon.awssdk.services.wellarchitected.model.ReviewTemplateAnswer 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;

/**
 * 

* An answer of the question. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReviewTemplateAnswer implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField QUESTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("QuestionId").getter(getter(ReviewTemplateAnswer::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(ReviewTemplateAnswer::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(ReviewTemplateAnswer::questionTitle)) .setter(setter(Builder::questionTitle)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuestionTitle").build()).build(); private static final SdkField QUESTION_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("QuestionDescription").getter(getter(ReviewTemplateAnswer::questionDescription)) .setter(setter(Builder::questionDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuestionDescription").build()) .build(); private static final SdkField IMPROVEMENT_PLAN_URL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ImprovementPlanUrl").getter(getter(ReviewTemplateAnswer::improvementPlanUrl)) .setter(setter(Builder::improvementPlanUrl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImprovementPlanUrl").build()) .build(); private static final SdkField HELPFUL_RESOURCE_URL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("HelpfulResourceUrl").getter(getter(ReviewTemplateAnswer::helpfulResourceUrl)) .setter(setter(Builder::helpfulResourceUrl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HelpfulResourceUrl").build()) .build(); private static final SdkField HELPFUL_RESOURCE_DISPLAY_TEXT_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("HelpfulResourceDisplayText") .getter(getter(ReviewTemplateAnswer::helpfulResourceDisplayText)) .setter(setter(Builder::helpfulResourceDisplayText)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HelpfulResourceDisplayText").build()) .build(); private static final SdkField> CHOICES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Choices") .getter(getter(ReviewTemplateAnswer::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(ReviewTemplateAnswer::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_ANSWERS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ChoiceAnswers") .getter(getter(ReviewTemplateAnswer::choiceAnswers)) .setter(setter(Builder::choiceAnswers)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChoiceAnswers").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ChoiceAnswer::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(ReviewTemplateAnswer::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(ReviewTemplateAnswer::answerStatusAsString)) .setter(setter(Builder::answerStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnswerStatus").build()).build(); private static final SdkField NOTES_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Notes") .getter(getter(ReviewTemplateAnswer::notes)).setter(setter(Builder::notes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Notes").build()).build(); private static final SdkField REASON_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Reason") .getter(getter(ReviewTemplateAnswer::reasonAsString)).setter(setter(Builder::reason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Reason").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(QUESTION_ID_FIELD, PILLAR_ID_FIELD, QUESTION_TITLE_FIELD, QUESTION_DESCRIPTION_FIELD, IMPROVEMENT_PLAN_URL_FIELD, HELPFUL_RESOURCE_URL_FIELD, HELPFUL_RESOURCE_DISPLAY_TEXT_FIELD, CHOICES_FIELD, SELECTED_CHOICES_FIELD, CHOICE_ANSWERS_FIELD, IS_APPLICABLE_FIELD, ANSWER_STATUS_FIELD, NOTES_FIELD, REASON_FIELD)); private static final long serialVersionUID = 1L; private final String questionId; private final String pillarId; private final String questionTitle; private final String questionDescription; private final String improvementPlanUrl; private final String helpfulResourceUrl; private final String helpfulResourceDisplayText; private final List choices; private final List selectedChoices; private final List choiceAnswers; private final Boolean isApplicable; private final String answerStatus; private final String notes; private final String reason; private ReviewTemplateAnswer(BuilderImpl builder) { this.questionId = builder.questionId; this.pillarId = builder.pillarId; this.questionTitle = builder.questionTitle; this.questionDescription = builder.questionDescription; this.improvementPlanUrl = builder.improvementPlanUrl; this.helpfulResourceUrl = builder.helpfulResourceUrl; this.helpfulResourceDisplayText = builder.helpfulResourceDisplayText; this.choices = builder.choices; this.selectedChoices = builder.selectedChoices; this.choiceAnswers = builder.choiceAnswers; this.isApplicable = builder.isApplicable; this.answerStatus = builder.answerStatus; this.notes = builder.notes; this.reason = builder.reason; } /** * 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; } /** * Returns the value of the QuestionDescription property for this object. * * @return The value of the QuestionDescription property for this object. */ public final String questionDescription() { return questionDescription; } /** * Returns the value of the ImprovementPlanUrl property for this object. * * @return The value of the ImprovementPlanUrl property for this object. */ public final String improvementPlanUrl() { return improvementPlanUrl; } /** * Returns the value of the HelpfulResourceUrl property for this object. * * @return The value of the HelpfulResourceUrl property for this object. */ public final String helpfulResourceUrl() { return helpfulResourceUrl; } /** *

* The helpful resource text to be displayed for a custom lens. *

* *

* This field does not apply to Amazon Web Services official lenses. *

*
* * @return The helpful resource text to be displayed for a custom lens.

*

* This field does not apply to Amazon Web Services official lenses. *

*/ public final String helpfulResourceDisplayText() { return helpfulResourceDisplayText; } /** * 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 ChoiceAnswers 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 hasChoiceAnswers() { return choiceAnswers != null && !(choiceAnswers instanceof SdkAutoConstructList); } /** *

* A list of selected choices to a question in your 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 #hasChoiceAnswers} method. *

* * @return A list of selected choices to a question in your review template. */ public final List choiceAnswers() { return choiceAnswers; } /** * 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; } /** * Returns the value of the Notes property for this object. * * @return The value of the Notes property for this object. */ public final String notes() { return notes; } /** *

* The reason why the question is not applicable to your 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 the question is not applicable to your review template. * @see AnswerReason */ public final AnswerReason reason() { return AnswerReason.fromValue(reason); } /** *

* The reason why the question is not applicable to your 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 the question is not applicable to your review template. * @see AnswerReason */ public final String reasonAsString() { return reason; } @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(questionDescription()); hashCode = 31 * hashCode + Objects.hashCode(improvementPlanUrl()); hashCode = 31 * hashCode + Objects.hashCode(helpfulResourceUrl()); hashCode = 31 * hashCode + Objects.hashCode(helpfulResourceDisplayText()); hashCode = 31 * hashCode + Objects.hashCode(hasChoices() ? choices() : null); hashCode = 31 * hashCode + Objects.hashCode(hasSelectedChoices() ? selectedChoices() : null); hashCode = 31 * hashCode + Objects.hashCode(hasChoiceAnswers() ? choiceAnswers() : null); hashCode = 31 * hashCode + Objects.hashCode(isApplicable()); hashCode = 31 * hashCode + Objects.hashCode(answerStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(notes()); hashCode = 31 * hashCode + Objects.hashCode(reasonAsString()); 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 ReviewTemplateAnswer)) { return false; } ReviewTemplateAnswer other = (ReviewTemplateAnswer) obj; return Objects.equals(questionId(), other.questionId()) && Objects.equals(pillarId(), other.pillarId()) && Objects.equals(questionTitle(), other.questionTitle()) && Objects.equals(questionDescription(), other.questionDescription()) && Objects.equals(improvementPlanUrl(), other.improvementPlanUrl()) && Objects.equals(helpfulResourceUrl(), other.helpfulResourceUrl()) && Objects.equals(helpfulResourceDisplayText(), other.helpfulResourceDisplayText()) && hasChoices() == other.hasChoices() && Objects.equals(choices(), other.choices()) && hasSelectedChoices() == other.hasSelectedChoices() && Objects.equals(selectedChoices(), other.selectedChoices()) && hasChoiceAnswers() == other.hasChoiceAnswers() && Objects.equals(choiceAnswers(), other.choiceAnswers()) && Objects.equals(isApplicable(), other.isApplicable()) && Objects.equals(answerStatusAsString(), other.answerStatusAsString()) && Objects.equals(notes(), other.notes()) && Objects.equals(reasonAsString(), other.reasonAsString()); } /** * 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("ReviewTemplateAnswer").add("QuestionId", questionId()).add("PillarId", pillarId()) .add("QuestionTitle", questionTitle()).add("QuestionDescription", questionDescription()) .add("ImprovementPlanUrl", improvementPlanUrl()).add("HelpfulResourceUrl", helpfulResourceUrl()) .add("HelpfulResourceDisplayText", helpfulResourceDisplayText()).add("Choices", hasChoices() ? choices() : null) .add("SelectedChoices", hasSelectedChoices() ? selectedChoices() : null) .add("ChoiceAnswers", hasChoiceAnswers() ? choiceAnswers() : null).add("IsApplicable", isApplicable()) .add("AnswerStatus", answerStatusAsString()).add("Notes", notes()).add("Reason", reasonAsString()).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 "QuestionDescription": return Optional.ofNullable(clazz.cast(questionDescription())); case "ImprovementPlanUrl": return Optional.ofNullable(clazz.cast(improvementPlanUrl())); case "HelpfulResourceUrl": return Optional.ofNullable(clazz.cast(helpfulResourceUrl())); case "HelpfulResourceDisplayText": return Optional.ofNullable(clazz.cast(helpfulResourceDisplayText())); case "Choices": return Optional.ofNullable(clazz.cast(choices())); case "SelectedChoices": return Optional.ofNullable(clazz.cast(selectedChoices())); case "ChoiceAnswers": return Optional.ofNullable(clazz.cast(choiceAnswers())); case "IsApplicable": return Optional.ofNullable(clazz.cast(isApplicable())); case "AnswerStatus": return Optional.ofNullable(clazz.cast(answerStatusAsString())); case "Notes": return Optional.ofNullable(clazz.cast(notes())); case "Reason": return Optional.ofNullable(clazz.cast(reasonAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReviewTemplateAnswer) 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 QuestionDescription property for this object. * * @param questionDescription * The new value for the QuestionDescription property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder questionDescription(String questionDescription); /** * Sets the value of the ImprovementPlanUrl property for this object. * * @param improvementPlanUrl * The new value for the ImprovementPlanUrl property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder improvementPlanUrl(String improvementPlanUrl); /** * Sets the value of the HelpfulResourceUrl property for this object. * * @param helpfulResourceUrl * The new value for the HelpfulResourceUrl property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder helpfulResourceUrl(String helpfulResourceUrl); /** *

* The helpful resource text to be displayed for a custom lens. *

* *

* This field does not apply to Amazon Web Services official lenses. *

*
* * @param helpfulResourceDisplayText * The helpful resource text to be displayed for a custom lens.

*

* This field does not apply to Amazon Web Services official lenses. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder helpfulResourceDisplayText(String helpfulResourceDisplayText); /** * 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 your review template. *

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

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

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

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

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

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

* The reason why the question is not applicable to your review template. *

* * @param reason * The reason why the question is not applicable to your 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 the question is not applicable to your review template. *

* * @param reason * The reason why the question is not applicable to your 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); } static final class BuilderImpl implements Builder { private String questionId; private String pillarId; private String questionTitle; private String questionDescription; private String improvementPlanUrl; private String helpfulResourceUrl; private String helpfulResourceDisplayText; private List choices = DefaultSdkAutoConstructList.getInstance(); private List selectedChoices = DefaultSdkAutoConstructList.getInstance(); private List choiceAnswers = DefaultSdkAutoConstructList.getInstance(); private Boolean isApplicable; private String answerStatus; private String notes; private String reason; private BuilderImpl() { } private BuilderImpl(ReviewTemplateAnswer model) { questionId(model.questionId); pillarId(model.pillarId); questionTitle(model.questionTitle); questionDescription(model.questionDescription); improvementPlanUrl(model.improvementPlanUrl); helpfulResourceUrl(model.helpfulResourceUrl); helpfulResourceDisplayText(model.helpfulResourceDisplayText); choices(model.choices); selectedChoices(model.selectedChoices); choiceAnswers(model.choiceAnswers); isApplicable(model.isApplicable); answerStatus(model.answerStatus); notes(model.notes); reason(model.reason); } 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 String getQuestionDescription() { return questionDescription; } public final void setQuestionDescription(String questionDescription) { this.questionDescription = questionDescription; } @Override public final Builder questionDescription(String questionDescription) { this.questionDescription = questionDescription; return this; } public final String getImprovementPlanUrl() { return improvementPlanUrl; } public final void setImprovementPlanUrl(String improvementPlanUrl) { this.improvementPlanUrl = improvementPlanUrl; } @Override public final Builder improvementPlanUrl(String improvementPlanUrl) { this.improvementPlanUrl = improvementPlanUrl; return this; } public final String getHelpfulResourceUrl() { return helpfulResourceUrl; } public final void setHelpfulResourceUrl(String helpfulResourceUrl) { this.helpfulResourceUrl = helpfulResourceUrl; } @Override public final Builder helpfulResourceUrl(String helpfulResourceUrl) { this.helpfulResourceUrl = helpfulResourceUrl; return this; } public final String getHelpfulResourceDisplayText() { return helpfulResourceDisplayText; } public final void setHelpfulResourceDisplayText(String helpfulResourceDisplayText) { this.helpfulResourceDisplayText = helpfulResourceDisplayText; } @Override public final Builder helpfulResourceDisplayText(String helpfulResourceDisplayText) { this.helpfulResourceDisplayText = helpfulResourceDisplayText; 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 getChoiceAnswers() { List result = ChoiceAnswersCopier.copyToBuilder(this.choiceAnswers); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setChoiceAnswers(Collection choiceAnswers) { this.choiceAnswers = ChoiceAnswersCopier.copyFromBuilder(choiceAnswers); } @Override public final Builder choiceAnswers(Collection choiceAnswers) { this.choiceAnswers = ChoiceAnswersCopier.copy(choiceAnswers); return this; } @Override @SafeVarargs public final Builder choiceAnswers(ChoiceAnswer... choiceAnswers) { choiceAnswers(Arrays.asList(choiceAnswers)); return this; } @Override @SafeVarargs public final Builder choiceAnswers(Consumer... choiceAnswers) { choiceAnswers(Stream.of(choiceAnswers).map(c -> ChoiceAnswer.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 getNotes() { return notes; } public final void setNotes(String notes) { this.notes = notes; } @Override public final Builder notes(String notes) { this.notes = notes; 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; } @Override public ReviewTemplateAnswer build() { return new ReviewTemplateAnswer(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy