com.google.protobuf.ValueKt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protobuf-kotlin-lite Show documentation
Show all versions of protobuf-kotlin-lite Show documentation
Lite version of Kotlin Protocol Buffers library. This version is optimized for code size, but does
not guarantee API/ABI stability.
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto
// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.protobuf;
@kotlin.jvm.JvmName("-initializevalue")
public inline fun value(block: com.google.protobuf.ValueKt.Dsl.() -> kotlin.Unit): com.google.protobuf.Value =
com.google.protobuf.ValueKt.Dsl._create(com.google.protobuf.Value.newBuilder()).apply { block() }._build()
/**
* ```
* `Value` represents a dynamically typed value which can be either
* null, a number, a string, a boolean, a recursive struct value, or a
* list of values. A producer of value is expected to set one of these
* variants. Absence of any variant indicates an error.
*
* The JSON representation for `Value` is JSON value.
* ```
*
* Protobuf type `google.protobuf.Value`
*/
public object ValueKt {
@kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
@com.google.protobuf.kotlin.ProtoDslMarker
public class Dsl private constructor(
private val _builder: com.google.protobuf.Value.Builder
) {
public companion object {
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _create(builder: com.google.protobuf.Value.Builder): Dsl = Dsl(builder)
}
@kotlin.jvm.JvmSynthetic
@kotlin.PublishedApi
internal fun _build(): com.google.protobuf.Value = _builder.build()
/**
* ```
* Represents a null value.
* ```
*
* `.google.protobuf.NullValue null_value = 1;`
*/
public var nullValue: com.google.protobuf.NullValue
@JvmName("getNullValue")
get() = _builder.getNullValue()
@JvmName("setNullValue")
set(value) {
_builder.setNullValue(value)
}
public var nullValueValue: kotlin.Int
@JvmName("getNullValueValue")
get() = _builder.getNullValueValue()
@JvmName("setNullValueValue")
set(value) {
_builder.setNullValueValue(value)
}
/**
* ```
* Represents a null value.
* ```
*
* `.google.protobuf.NullValue null_value = 1;`
*/
public fun clearNullValue() {
_builder.clearNullValue()
}
/**
* ```
* Represents a null value.
* ```
*
* `.google.protobuf.NullValue null_value = 1;`
* @return Whether the nullValue field is set.
*/
public fun hasNullValue(): kotlin.Boolean {
return _builder.hasNullValue()
}
/**
*
* Represents a double value.
*
*
* double number_value = 2;
*/
public var numberValue: kotlin.Double
@JvmName("getNumberValue")
get() = _builder.getNumberValue()
@JvmName("setNumberValue")
set(value) {
_builder.setNumberValue(value)
}
/**
* ```
* Represents a double value.
* ```
*
* `double number_value = 2;`
*/
public fun clearNumberValue() {
_builder.clearNumberValue()
}
/**
* ```
* Represents a double value.
* ```
*
* `double number_value = 2;`
* @return Whether the numberValue field is set.
*/
public fun hasNumberValue(): kotlin.Boolean {
return _builder.hasNumberValue()
}
/**
* ```
* Represents a string value.
* ```
*
* `string string_value = 3;`
*/
public var stringValue: kotlin.String
@JvmName("getStringValue")
get() = _builder.getStringValue()
@JvmName("setStringValue")
set(value) {
_builder.setStringValue(value)
}
/**
* ```
* Represents a string value.
* ```
*
* `string string_value = 3;`
*/
public fun clearStringValue() {
_builder.clearStringValue()
}
/**
* ```
* Represents a string value.
* ```
*
* `string string_value = 3;`
* @return Whether the stringValue field is set.
*/
public fun hasStringValue(): kotlin.Boolean {
return _builder.hasStringValue()
}
/**
*
* Represents a boolean value.
*
*
* bool bool_value = 4;
*/
public var boolValue: kotlin.Boolean
@JvmName("getBoolValue")
get() = _builder.getBoolValue()
@JvmName("setBoolValue")
set(value) {
_builder.setBoolValue(value)
}
/**
* ```
* Represents a boolean value.
* ```
*
* `bool bool_value = 4;`
*/
public fun clearBoolValue() {
_builder.clearBoolValue()
}
/**
* ```
* Represents a boolean value.
* ```
*
* `bool bool_value = 4;`
* @return Whether the boolValue field is set.
*/
public fun hasBoolValue(): kotlin.Boolean {
return _builder.hasBoolValue()
}
/**
* ```
* Represents a structured value.
* ```
*
* `.google.protobuf.Struct struct_value = 5;`
*/
public var structValue: com.google.protobuf.Struct
@JvmName("getStructValue")
get() = _builder.getStructValue()
@JvmName("setStructValue")
set(value) {
_builder.setStructValue(value)
}
/**
* ```
* Represents a structured value.
* ```
*
* `.google.protobuf.Struct struct_value = 5;`
*/
public fun clearStructValue() {
_builder.clearStructValue()
}
/**
* ```
* Represents a structured value.
* ```
*
* `.google.protobuf.Struct struct_value = 5;`
* @return Whether the structValue field is set.
*/
public fun hasStructValue(): kotlin.Boolean {
return _builder.hasStructValue()
}
/**
* ```
* Represents a repeated `Value`.
* ```
*
* `.google.protobuf.ListValue list_value = 6;`
*/
public var listValue: com.google.protobuf.ListValue
@JvmName("getListValue")
get() = _builder.getListValue()
@JvmName("setListValue")
set(value) {
_builder.setListValue(value)
}
/**
* ```
* Represents a repeated `Value`.
* ```
*
* `.google.protobuf.ListValue list_value = 6;`
*/
public fun clearListValue() {
_builder.clearListValue()
}
/**
* ```
* Represents a repeated `Value`.
* ```
*
* `.google.protobuf.ListValue list_value = 6;`
* @return Whether the listValue field is set.
*/
public fun hasListValue(): kotlin.Boolean {
return _builder.hasListValue()
}
public val kindCase: com.google.protobuf.Value.KindCase
@JvmName("getKindCase")
get() = _builder.getKindCase()
public fun clearKind() {
_builder.clearKind()
}
}
}
public inline fun com.google.protobuf.Value.copy(block: com.google.protobuf.ValueKt.Dsl.() -> kotlin.Unit): com.google.protobuf.Value =
com.google.protobuf.ValueKt.Dsl._create(this.toBuilder()).apply { block() }._build()
public val com.google.protobuf.ValueOrBuilder.structValueOrNull: com.google.protobuf.Struct?
get() = if (hasStructValue()) getStructValue() else null
public val com.google.protobuf.ValueOrBuilder.listValueOrNull: com.google.protobuf.ListValue?
get() = if (hasListValue()) getListValue() else null