All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.xray.model.AnnotationValue.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.xray.model



/**
 * Value of a segment annotation. Has one of three value types: Number, Boolean, or String.
 */
public sealed class AnnotationValue {
    /**
     * Value for a Boolean annotation.
     */
    public data class BooleanValue(val value: kotlin.Boolean) : aws.sdk.kotlin.services.xray.model.AnnotationValue() {
    }

    /**
     * Value for a Number annotation.
     */
    public data class NumberValue(val value: kotlin.Double) : aws.sdk.kotlin.services.xray.model.AnnotationValue() {
    }

    /**
     * Value for a String annotation.
     */
    public data class StringValue(val value: kotlin.String) : aws.sdk.kotlin.services.xray.model.AnnotationValue() {
    }

    public object SdkUnknown : aws.sdk.kotlin.services.xray.model.AnnotationValue() {
    }

    /**
     * Casts this [AnnotationValue] as a [BooleanValue] and retrieves its [kotlin.Boolean] value. Throws an exception if the [AnnotationValue] is not a
     * [BooleanValue].
     */
    public fun asBooleanValue(): kotlin.Boolean = (this as AnnotationValue.BooleanValue).value

    /**
     * Casts this [AnnotationValue] as a [BooleanValue] and retrieves its [kotlin.Boolean] value. Returns null if the [AnnotationValue] is not a [BooleanValue].
     */
    public fun asBooleanValueOrNull(): kotlin.Boolean? = (this as? AnnotationValue.BooleanValue)?.value

    /**
     * Casts this [AnnotationValue] as a [NumberValue] and retrieves its [kotlin.Double] value. Throws an exception if the [AnnotationValue] is not a
     * [NumberValue].
     */
    public fun asNumberValue(): kotlin.Double = (this as AnnotationValue.NumberValue).value

    /**
     * Casts this [AnnotationValue] as a [NumberValue] and retrieves its [kotlin.Double] value. Returns null if the [AnnotationValue] is not a [NumberValue].
     */
    public fun asNumberValueOrNull(): kotlin.Double? = (this as? AnnotationValue.NumberValue)?.value

    /**
     * Casts this [AnnotationValue] as a [StringValue] and retrieves its [kotlin.String] value. Throws an exception if the [AnnotationValue] is not a
     * [StringValue].
     */
    public fun asStringValue(): kotlin.String = (this as AnnotationValue.StringValue).value

    /**
     * Casts this [AnnotationValue] as a [StringValue] and retrieves its [kotlin.String] value. Returns null if the [AnnotationValue] is not a [StringValue].
     */
    public fun asStringValueOrNull(): kotlin.String? = (this as? AnnotationValue.StringValue)?.value
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy