/* * 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 section from an evaluation form. A section can contain * sections and/or questions. Evaluation forms can only contain sections and * subsections (two level nesting). *

*/ public class EvaluationFormSection implements Serializable { /** *

* The title of the section. *

*

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

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

*

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

* The instructions of the section. *

*

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

* The items of the section. *

*/ private java.util.List items; /** *

* The scoring weight of the section. *

*

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

* The title of the section. *

*

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

* The title of the section. *

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

* The title of the section. *

*

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

* The title of the section. *

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

* The title of the section. *

*

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

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

* The title of the section. *

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

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

*

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

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

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

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

*

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

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

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

* The identifier of the section. 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 section. 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 EvaluationFormSection withRefId(String refId) { this.refId = refId; 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 EvaluationFormSection withInstructions(String instructions) { this.instructions = instructions; return this; } /** *

* The items of the section. *

* * @return

* The items of the section. *

*/ public java.util.List getItems() { return items; } /** *

* The items of the section. *

* * @param items

* The items of the section. *

*/ public void setItems(java.util.Collection items) { if (items == null) { this.items = null; return; } this.items = new java.util.ArrayList(items); } /** *

* The items of the section. *

*

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

* The items of the section. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormSection withItems(EvaluationFormItem... items) { if (getItems() == null) { this.items = new java.util.ArrayList(items.length); } for (EvaluationFormItem value : items) { this.items.add(value); } return this; } /** *

* The items of the section. *

*

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

* The items of the section. *

* @return A reference to this updated object so that method calls can be * chained together. */ public EvaluationFormSection withItems(java.util.Collection items) { setItems(items); 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 EvaluationFormSection 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 (getRefId() != null) sb.append("RefId: " + getRefId() + ","); if (getInstructions() != null) sb.append("Instructions: " + getInstructions() + ","); if (getItems() != null) sb.append("Items: " + getItems() + ","); 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 + ((getRefId() == null) ? 0 : getRefId().hashCode()); hashCode = prime * hashCode + ((getInstructions() == null) ? 0 : getInstructions().hashCode()); hashCode = prime * hashCode + ((getItems() == null) ? 0 : getItems().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 EvaluationFormSection == false) return false; EvaluationFormSection other = (EvaluationFormSection) obj; if (other.getTitle() == null ^ this.getTitle() == null) return false; if (other.getTitle() != null && other.getTitle().equals(this.getTitle()) == 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.getInstructions() == null ^ this.getInstructions() == null) return false; if (other.getInstructions() != null && other.getInstructions().equals(this.getInstructions()) == false) return false; if (other.getItems() == null ^ this.getItems() == null) return false; if (other.getItems() != null && other.getItems().equals(this.getItems()) == 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; } }