
commonMain.aws.sdk.kotlin.services.comprehend.model.MentionSentiment.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.comprehend.model
/**
* Contains the sentiment and sentiment score for one mention of an entity.
*
* For more information about targeted sentiment, see [Targeted sentiment](https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html).
*/
public class MentionSentiment private constructor(builder: Builder) {
/**
* The sentiment of the mention.
*/
public val sentiment: aws.sdk.kotlin.services.comprehend.model.SentimentType? = builder.sentiment
/**
* Describes the level of confidence that Amazon Comprehend has in the accuracy of its detection of sentiments.
*/
public val sentimentScore: aws.sdk.kotlin.services.comprehend.model.SentimentScore? = builder.sentimentScore
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.MentionSentiment = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MentionSentiment(")
append("sentiment=$sentiment,")
append("sentimentScore=$sentimentScore")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = sentiment?.hashCode() ?: 0
result = 31 * result + (sentimentScore?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as MentionSentiment
if (sentiment != other.sentiment) return false
if (sentimentScore != other.sentimentScore) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.MentionSentiment = Builder(this).apply(block).build()
public class Builder {
/**
* The sentiment of the mention.
*/
public var sentiment: aws.sdk.kotlin.services.comprehend.model.SentimentType? = null
/**
* Describes the level of confidence that Amazon Comprehend has in the accuracy of its detection of sentiments.
*/
public var sentimentScore: aws.sdk.kotlin.services.comprehend.model.SentimentScore? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.comprehend.model.MentionSentiment) : this() {
this.sentiment = x.sentiment
this.sentimentScore = x.sentimentScore
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.comprehend.model.MentionSentiment = MentionSentiment(this)
/**
* construct an [aws.sdk.kotlin.services.comprehend.model.SentimentScore] inside the given [block]
*/
public fun sentimentScore(block: aws.sdk.kotlin.services.comprehend.model.SentimentScore.Builder.() -> kotlin.Unit) {
this.sentimentScore = aws.sdk.kotlin.services.comprehend.model.SentimentScore.invoke(block)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy