
commonMain.aws.sdk.kotlin.services.redshiftdata.model.Field.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.redshiftdata.model
/**
* A data value in a column.
*/
public sealed class Field {
/**
* A value of the BLOB data type.
*/
public data class BlobValue(val value: kotlin.ByteArray) : aws.sdk.kotlin.services.redshiftdata.model.Field() {
override fun hashCode(): kotlin.Int {
return value.contentHashCode()
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as BlobValue
if (!value.contentEquals(other.value)) return false
return true
}
}
/**
* A value of the Boolean data type.
*/
public data class BooleanValue(val value: kotlin.Boolean) : aws.sdk.kotlin.services.redshiftdata.model.Field() {
}
/**
* A value of the double data type.
*/
public data class DoubleValue(val value: kotlin.Double) : aws.sdk.kotlin.services.redshiftdata.model.Field() {
}
/**
* A value that indicates whether the data is NULL.
*/
public data class IsNull(val value: kotlin.Boolean) : aws.sdk.kotlin.services.redshiftdata.model.Field() {
}
/**
* A value of the long data type.
*/
public data class LongValue(val value: kotlin.Long) : aws.sdk.kotlin.services.redshiftdata.model.Field() {
}
/**
* A value of the string data type.
*/
public data class StringValue(val value: kotlin.String) : aws.sdk.kotlin.services.redshiftdata.model.Field() {
}
public object SdkUnknown : aws.sdk.kotlin.services.redshiftdata.model.Field() {
}
/**
* Casts this [Field] as a [BlobValue] and retrieves its [kotlin.ByteArray] value. Throws an exception if the [Field] is not a
* [BlobValue].
*/
public fun asBlobValue(): kotlin.ByteArray = (this as Field.BlobValue).value
/**
* Casts this [Field] as a [BlobValue] and retrieves its [kotlin.ByteArray] value. Returns null if the [Field] is not a [BlobValue].
*/
public fun asBlobValueOrNull(): kotlin.ByteArray? = (this as? Field.BlobValue)?.value
/**
* Casts this [Field] as a [BooleanValue] and retrieves its [kotlin.Boolean] value. Throws an exception if the [Field] is not a
* [BooleanValue].
*/
public fun asBooleanValue(): kotlin.Boolean = (this as Field.BooleanValue).value
/**
* Casts this [Field] as a [BooleanValue] and retrieves its [kotlin.Boolean] value. Returns null if the [Field] is not a [BooleanValue].
*/
public fun asBooleanValueOrNull(): kotlin.Boolean? = (this as? Field.BooleanValue)?.value
/**
* Casts this [Field] as a [DoubleValue] and retrieves its [kotlin.Double] value. Throws an exception if the [Field] is not a
* [DoubleValue].
*/
public fun asDoubleValue(): kotlin.Double = (this as Field.DoubleValue).value
/**
* Casts this [Field] as a [DoubleValue] and retrieves its [kotlin.Double] value. Returns null if the [Field] is not a [DoubleValue].
*/
public fun asDoubleValueOrNull(): kotlin.Double? = (this as? Field.DoubleValue)?.value
/**
* Casts this [Field] as a [IsNull] and retrieves its [kotlin.Boolean] value. Throws an exception if the [Field] is not a
* [IsNull].
*/
public fun asIsNull(): kotlin.Boolean = (this as Field.IsNull).value
/**
* Casts this [Field] as a [IsNull] and retrieves its [kotlin.Boolean] value. Returns null if the [Field] is not a [IsNull].
*/
public fun asIsNullOrNull(): kotlin.Boolean? = (this as? Field.IsNull)?.value
/**
* Casts this [Field] as a [LongValue] and retrieves its [kotlin.Long] value. Throws an exception if the [Field] is not a
* [LongValue].
*/
public fun asLongValue(): kotlin.Long = (this as Field.LongValue).value
/**
* Casts this [Field] as a [LongValue] and retrieves its [kotlin.Long] value. Returns null if the [Field] is not a [LongValue].
*/
public fun asLongValueOrNull(): kotlin.Long? = (this as? Field.LongValue)?.value
/**
* Casts this [Field] as a [StringValue] and retrieves its [kotlin.String] value. Throws an exception if the [Field] is not a
* [StringValue].
*/
public fun asStringValue(): kotlin.String = (this as Field.StringValue).value
/**
* Casts this [Field] as a [StringValue] and retrieves its [kotlin.String] value. Returns null if the [Field] is not a [StringValue].
*/
public fun asStringValueOrNull(): kotlin.String? = (this as? Field.StringValue)?.value
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy