com.amazonaws.services.comprehend.model.SentimentScore Maven / Gradle / Ivy
Show all versions of aws-java-sdk-comprehend Show documentation
/*
* Copyright 2018-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.comprehend.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the level of confidence that Amazon Comprehend has in the accuracy of its detection of sentiments.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SentimentScore implements Serializable, Cloneable, StructuredPojo {
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE
* sentiment.
*
*/
private Float positive;
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE
* sentiment.
*
*/
private Float negative;
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL
* sentiment.
*
*/
private Float neutral;
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED
* sentiment.
*
*/
private Float mixed;
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE
* sentiment.
*
*
* @param positive
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* POSITIVE
sentiment.
*/
public void setPositive(Float positive) {
this.positive = positive;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE
* sentiment.
*
*
* @return The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* POSITIVE
sentiment.
*/
public Float getPositive() {
return this.positive;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the POSITIVE
* sentiment.
*
*
* @param positive
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* POSITIVE
sentiment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SentimentScore withPositive(Float positive) {
setPositive(positive);
return this;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE
* sentiment.
*
*
* @param negative
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* NEGATIVE
sentiment.
*/
public void setNegative(Float negative) {
this.negative = negative;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE
* sentiment.
*
*
* @return The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* NEGATIVE
sentiment.
*/
public Float getNegative() {
return this.negative;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEGATIVE
* sentiment.
*
*
* @param negative
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* NEGATIVE
sentiment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SentimentScore withNegative(Float negative) {
setNegative(negative);
return this;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL
* sentiment.
*
*
* @param neutral
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* NEUTRAL
sentiment.
*/
public void setNeutral(Float neutral) {
this.neutral = neutral;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL
* sentiment.
*
*
* @return The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* NEUTRAL
sentiment.
*/
public Float getNeutral() {
return this.neutral;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the NEUTRAL
* sentiment.
*
*
* @param neutral
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* NEUTRAL
sentiment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SentimentScore withNeutral(Float neutral) {
setNeutral(neutral);
return this;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED
* sentiment.
*
*
* @param mixed
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* MIXED
sentiment.
*/
public void setMixed(Float mixed) {
this.mixed = mixed;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED
* sentiment.
*
*
* @return The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* MIXED
sentiment.
*/
public Float getMixed() {
return this.mixed;
}
/**
*
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the MIXED
* sentiment.
*
*
* @param mixed
* The level of confidence that Amazon Comprehend has in the accuracy of its detection of the
* MIXED
sentiment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SentimentScore withMixed(Float mixed) {
setMixed(mixed);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getPositive() != null)
sb.append("Positive: ").append(getPositive()).append(",");
if (getNegative() != null)
sb.append("Negative: ").append(getNegative()).append(",");
if (getNeutral() != null)
sb.append("Neutral: ").append(getNeutral()).append(",");
if (getMixed() != null)
sb.append("Mixed: ").append(getMixed());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SentimentScore == false)
return false;
SentimentScore other = (SentimentScore) obj;
if (other.getPositive() == null ^ this.getPositive() == null)
return false;
if (other.getPositive() != null && other.getPositive().equals(this.getPositive()) == false)
return false;
if (other.getNegative() == null ^ this.getNegative() == null)
return false;
if (other.getNegative() != null && other.getNegative().equals(this.getNegative()) == false)
return false;
if (other.getNeutral() == null ^ this.getNeutral() == null)
return false;
if (other.getNeutral() != null && other.getNeutral().equals(this.getNeutral()) == false)
return false;
if (other.getMixed() == null ^ this.getMixed() == null)
return false;
if (other.getMixed() != null && other.getMixed().equals(this.getMixed()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPositive() == null) ? 0 : getPositive().hashCode());
hashCode = prime * hashCode + ((getNegative() == null) ? 0 : getNegative().hashCode());
hashCode = prime * hashCode + ((getNeutral() == null) ? 0 : getNeutral().hashCode());
hashCode = prime * hashCode + ((getMixed() == null) ? 0 : getMixed().hashCode());
return hashCode;
}
@Override
public SentimentScore clone() {
try {
return (SentimentScore) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.comprehend.model.transform.SentimentScoreMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}