/* * Copyright 2010-2023 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 com.amazonaws.services.connect.model; import java.io.Serializable; /** *

* Information about a question from an evaluation form. *

*/ public class EvaluationFormQuestion implements Serializable { /** *

* The title of the question. *

*

* Constraints:
* Length: 0 - 350
*/ private String title; /** *

* The instructions of the section. *

*

* Constraints:
* Length: 0 - 1024
*/ private String instructions; /** *

* The identifier of the question. An identifier must be unique within the * evaluation form. *

*

* Constraints:
* Length: 1 - 40
*/ private String refId; /** *

* The flag to enable not applicable answers to the question. *

*/ private Boolean notApplicableEnabled; /** *

* The type of the question. *

*

* Constraints:
* Allowed Values: TEXT, SINGLESELECT, NUMERIC */ private String questionType; /** *

* The properties of the type of question. Text questions do not have to * define question type properties. *

*/ private EvaluationFormQuestionTypeProperties questionTypeProperties; /** *

* The scoring weight of the section. *

*

* Constraints:
* Range: 0.0 - 100.0
*/ private Double weight; /** *

* The title of the question. *

*

* Constraints:
* Length: 0 - 350
* * @return

* The title of the question. *

*/ public String getTitle() { return title; } /** *

* The title of the question. *

*

* Constraints:
* Length: 0 - 350
* * @param title

* The title of the question. *

*/ public void setTitle(String title) { this.title = title; } /** *

* The title of the question. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 0 - 350
* * @param title

* The title of the question. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormQuestion withTitle(String title) { this.title = title; return this; } /** *

* The instructions of the section. *

*

* Constraints:
* Length: 0 - 1024
* * @return

* The instructions of the section. *

*/ public String getInstructions() { return instructions; } /** *

* The instructions of the section. *

*

* Constraints:
* Length: 0 - 1024
* * @param instructions

* The instructions of the section. *

*/ public void setInstructions(String instructions) { this.instructions = instructions; } /** *

* The instructions of the section. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 0 - 1024
* * @param instructions

* The instructions of the section. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormQuestion withInstructions(String instructions) { this.instructions = instructions; return this; } /** *

* The identifier of the question. An identifier must be unique within the * evaluation form. *

*

* Constraints:
* Length: 1 - 40
* * @return

* The identifier of the question. An identifier must be unique * within the evaluation form. *

*/ public String getRefId() { return refId; } /** *

* The identifier of the question. An identifier must be unique within the * evaluation form. *

*

* Constraints:
* Length: 1 - 40
* * @param refId

* The identifier of the question. An identifier must be unique * within the evaluation form. *

*/ public void setRefId(String refId) { this.refId = refId; } /** *

* The identifier of the question. An identifier must be unique within the * evaluation form. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 40
* * @param refId

* The identifier of the question. An identifier must be unique * within the evaluation form. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormQuestion withRefId(String refId) { this.refId = refId; return this; } /** *

* The flag to enable not applicable answers to the question. *

* * @return

* The flag to enable not applicable answers to the question. *

*/ public Boolean isNotApplicableEnabled() { return notApplicableEnabled; } /** *

* The flag to enable not applicable answers to the question. *

* * @return

* The flag to enable not applicable answers to the question. *

*/ public Boolean getNotApplicableEnabled() { return notApplicableEnabled; } /** *

* The flag to enable not applicable answers to the question. *

* * @param notApplicableEnabled

* The flag to enable not applicable answers to the question. *

*/ public void setNotApplicableEnabled(Boolean notApplicableEnabled) { this.notApplicableEnabled = notApplicableEnabled; } /** *

* The flag to enable not applicable answers to the question. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param notApplicableEnabled

* The flag to enable not applicable answers to the question. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormQuestion withNotApplicableEnabled(Boolean notApplicableEnabled) { this.notApplicableEnabled = notApplicableEnabled; return this; } /** *

* The type of the question. *

*

* Constraints:
* Allowed Values: TEXT, SINGLESELECT, NUMERIC * * @return

* The type of the question. *

* @see EvaluationFormQuestionType */ public String getQuestionType() { return questionType; } /** *

* The type of the question. *

*

* Constraints:
* Allowed Values: TEXT, SINGLESELECT, NUMERIC * * @param questionType

* The type of the question. *

* @see EvaluationFormQuestionType */ public void setQuestionType(String questionType) { this.questionType = questionType; } /** *

* The type of the question. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: TEXT, SINGLESELECT, NUMERIC * * @param questionType

* The type of the question. *

* @return A reference to this updated object so that method calls can be * chained together. * @see EvaluationFormQuestionType */ public EvaluationFormQuestion withQuestionType(String questionType) { this.questionType = questionType; return this; } /** *

* The type of the question. *

*

* Constraints:
* Allowed Values: TEXT, SINGLESELECT, NUMERIC * * @param questionType

* The type of the question. *

* @see EvaluationFormQuestionType */ public void setQuestionType(EvaluationFormQuestionType questionType) { this.questionType = questionType.toString(); } /** *

* The type of the question. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: TEXT, SINGLESELECT, NUMERIC * * @param questionType

* The type of the question. *

* @return A reference to this updated object so that method calls can be * chained together. * @see EvaluationFormQuestionType */ public EvaluationFormQuestion withQuestionType(EvaluationFormQuestionType questionType) { this.questionType = questionType.toString(); return this; } /** *

* The properties of the type of question. Text questions do not have to * define question type properties. *

* * @return

* The properties of the type of question. Text questions do not * have to define question type properties. *

*/ public EvaluationFormQuestionTypeProperties getQuestionTypeProperties() { return questionTypeProperties; } /** *

* The properties of the type of question. Text questions do not have to * define question type properties. *

* * @param questionTypeProperties

* The properties of the type of question. Text questions do not * have to define question type properties. *

*/ public void setQuestionTypeProperties( EvaluationFormQuestionTypeProperties questionTypeProperties) { this.questionTypeProperties = questionTypeProperties; } /** *

* The properties of the type of question. Text questions do not have to * define question type properties. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param questionTypeProperties

* The properties of the type of question. Text questions do not * have to define question type properties. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormQuestion withQuestionTypeProperties( EvaluationFormQuestionTypeProperties questionTypeProperties) { this.questionTypeProperties = questionTypeProperties; return this; } /** *

* The scoring weight of the section. *

*

* Constraints:
* Range: 0.0 - 100.0
* * @return

* The scoring weight of the section. *

*/ public Double getWeight() { return weight; } /** *

* The scoring weight of the section. *

*

* Constraints:
* Range: 0.0 - 100.0
* * @param weight

* The scoring weight of the section. *

*/ public void setWeight(Double weight) { this.weight = weight; } /** *

* The scoring weight of the section. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0.0 - 100.0
* * @param weight

* The scoring weight of the section. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormQuestion withWeight(Double weight) { this.weight = weight; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getTitle() != null) sb.append("Title: " + getTitle() + ","); if (getInstructions() != null) sb.append("Instructions: " + getInstructions() + ","); if (getRefId() != null) sb.append("RefId: " + getRefId() + ","); if (getNotApplicableEnabled() != null) sb.append("NotApplicableEnabled: " + getNotApplicableEnabled() + ","); if (getQuestionType() != null) sb.append("QuestionType: " + getQuestionType() + ","); if (getQuestionTypeProperties() != null) sb.append("QuestionTypeProperties: " + getQuestionTypeProperties() + ","); if (getWeight() != null) sb.append("Weight: " + getWeight()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTitle() == null) ? 0 : getTitle().hashCode()); hashCode = prime * hashCode + ((getInstructions() == null) ? 0 : getInstructions().hashCode()); hashCode = prime * hashCode + ((getRefId() == null) ? 0 : getRefId().hashCode()); hashCode = prime * hashCode + ((getNotApplicableEnabled() == null) ? 0 : getNotApplicableEnabled().hashCode()); hashCode = prime * hashCode + ((getQuestionType() == null) ? 0 : getQuestionType().hashCode()); hashCode = prime * hashCode + ((getQuestionTypeProperties() == null) ? 0 : getQuestionTypeProperties() .hashCode()); hashCode = prime * hashCode + ((getWeight() == null) ? 0 : getWeight().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof EvaluationFormQuestion == false) return false; EvaluationFormQuestion other = (EvaluationFormQuestion) obj; if (other.getTitle() == null ^ this.getTitle() == null) return false; if (other.getTitle() != null && other.getTitle().equals(this.getTitle()) == false) return false; if (other.getInstructions() == null ^ this.getInstructions() == null) return false; if (other.getInstructions() != null && other.getInstructions().equals(this.getInstructions()) == false) return false; if (other.getRefId() == null ^ this.getRefId() == null) return false; if (other.getRefId() != null && other.getRefId().equals(this.getRefId()) == false) return false; if (other.getNotApplicableEnabled() == null ^ this.getNotApplicableEnabled() == null) return false; if (other.getNotApplicableEnabled() != null && other.getNotApplicableEnabled().equals(this.getNotApplicableEnabled()) == false) return false; if (other.getQuestionType() == null ^ this.getQuestionType() == null) return false; if (other.getQuestionType() != null && other.getQuestionType().equals(this.getQuestionType()) == false) return false; if (other.getQuestionTypeProperties() == null ^ this.getQuestionTypeProperties() == null) return false; if (other.getQuestionTypeProperties() != null && other.getQuestionTypeProperties().equals(this.getQuestionTypeProperties()) == false) return false; if (other.getWeight() == null ^ this.getWeight() == null) return false; if (other.getWeight() != null && other.getWeight().equals(this.getWeight()) == false) return false; return true; } }