|
| 1 | +/* |
| 2 | + * Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"). |
| 5 | + * You may not use this file except in compliance with the License. |
| 6 | + * A copy of the License is located at |
| 7 | + * |
| 8 | + * http://aws.amazon.com/apache2.0 |
| 9 | + * |
| 10 | + * or in the "license" file accompanying this file. This file is distributed |
| 11 | + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | + * express or implied. See the License for the specific language governing |
| 13 | + * permissions and limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +package com.amazonaws.services.lexrts.model; |
| 17 | + |
| 18 | +import java.io.Serializable; |
| 19 | + |
| 20 | +/** |
| 21 | + * <p> |
| 22 | + * Provides a score that indicates the confidence that Amazon Lex has that an |
| 23 | + * intent is the one that satisfies the user's intent. |
| 24 | + * </p> |
| 25 | + */ |
| 26 | +public class IntentConfidence implements Serializable { |
| 27 | + /** |
| 28 | + * <p> |
| 29 | + * A score that indicates how confident Amazon Lex is that an intent |
| 30 | + * satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores |
| 31 | + * indicate higher confidence. |
| 32 | + * </p> |
| 33 | + */ |
| 34 | + private Double score; |
| 35 | + |
| 36 | + /** |
| 37 | + * <p> |
| 38 | + * A score that indicates how confident Amazon Lex is that an intent |
| 39 | + * satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores |
| 40 | + * indicate higher confidence. |
| 41 | + * </p> |
| 42 | + * |
| 43 | + * @return <p> |
| 44 | + * A score that indicates how confident Amazon Lex is that an intent |
| 45 | + * satisfies the user's intent. Ranges between 0.00 and 1.00. Higher |
| 46 | + * scores indicate higher confidence. |
| 47 | + * </p> |
| 48 | + */ |
| 49 | + public Double getScore() { |
| 50 | + return score; |
| 51 | + } |
| 52 | + |
| 53 | + /** |
| 54 | + * <p> |
| 55 | + * A score that indicates how confident Amazon Lex is that an intent |
| 56 | + * satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores |
| 57 | + * indicate higher confidence. |
| 58 | + * </p> |
| 59 | + * |
| 60 | + * @param score <p> |
| 61 | + * A score that indicates how confident Amazon Lex is that an |
| 62 | + * intent satisfies the user's intent. Ranges between 0.00 and |
| 63 | + * 1.00. Higher scores indicate higher confidence. |
| 64 | + * </p> |
| 65 | + */ |
| 66 | + public void setScore(Double score) { |
| 67 | + this.score = score; |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * <p> |
| 72 | + * A score that indicates how confident Amazon Lex is that an intent |
| 73 | + * satisfies the user's intent. Ranges between 0.00 and 1.00. Higher scores |
| 74 | + * indicate higher confidence. |
| 75 | + * </p> |
| 76 | + * <p> |
| 77 | + * Returns a reference to this object so that method calls can be chained |
| 78 | + * together. |
| 79 | + * |
| 80 | + * @param score <p> |
| 81 | + * A score that indicates how confident Amazon Lex is that an |
| 82 | + * intent satisfies the user's intent. Ranges between 0.00 and |
| 83 | + * 1.00. Higher scores indicate higher confidence. |
| 84 | + * </p> |
| 85 | + * @return A reference to this updated object so that method calls can be |
| 86 | + * chained together. |
| 87 | + */ |
| 88 | + public IntentConfidence withScore(Double score) { |
| 89 | + this.score = score; |
| 90 | + return this; |
| 91 | + } |
| 92 | + |
| 93 | + /** |
| 94 | + * Returns a string representation of this object; useful for testing and |
| 95 | + * debugging. |
| 96 | + * |
| 97 | + * @return A string representation of this object. |
| 98 | + * @see java.lang.Object#toString() |
| 99 | + */ |
| 100 | + @Override |
| 101 | + public String toString() { |
| 102 | + StringBuilder sb = new StringBuilder(); |
| 103 | + sb.append("{"); |
| 104 | + if (getScore() != null) |
| 105 | + sb.append("score: " + getScore()); |
| 106 | + sb.append("}"); |
| 107 | + return sb.toString(); |
| 108 | + } |
| 109 | + |
| 110 | + @Override |
| 111 | + public int hashCode() { |
| 112 | + final int prime = 31; |
| 113 | + int hashCode = 1; |
| 114 | + |
| 115 | + hashCode = prime * hashCode + ((getScore() == null) ? 0 : getScore().hashCode()); |
| 116 | + return hashCode; |
| 117 | + } |
| 118 | + |
| 119 | + @Override |
| 120 | + public boolean equals(Object obj) { |
| 121 | + if (this == obj) |
| 122 | + return true; |
| 123 | + if (obj == null) |
| 124 | + return false; |
| 125 | + |
| 126 | + if (obj instanceof IntentConfidence == false) |
| 127 | + return false; |
| 128 | + IntentConfidence other = (IntentConfidence) obj; |
| 129 | + |
| 130 | + if (other.getScore() == null ^ this.getScore() == null) |
| 131 | + return false; |
| 132 | + if (other.getScore() != null && other.getScore().equals(this.getScore()) == false) |
| 133 | + return false; |
| 134 | + return true; |
| 135 | + } |
| 136 | +} |
0 commit comments