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

com.google.protobuf.EnumKt.kt Maven / Gradle / Ivy

Go to download

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/type.proto

// Generated files should ignore deprecation warnings
@file:Suppress("DEPRECATION")
package com.google.protobuf;

@kotlin.jvm.JvmName("-initializeenum")
public inline fun enum(block: com.google.protobuf.EnumKt.Dsl.() -> kotlin.Unit): com.google.protobuf.Enum =
  com.google.protobuf.EnumKt.Dsl._create(com.google.protobuf.Enum.newBuilder()).apply { block() }._build()
/**
 * ```
 * Enum type definition.
 * ```
 *
 * Protobuf type `google.protobuf.Enum`
 */
public object EnumKt {
  @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
  @com.google.protobuf.kotlin.ProtoDslMarker
  public class Dsl private constructor(
    private val _builder: com.google.protobuf.Enum.Builder
  ) {
    public companion object {
      @kotlin.jvm.JvmSynthetic
      @kotlin.PublishedApi
      internal fun _create(builder: com.google.protobuf.Enum.Builder): Dsl = Dsl(builder)
    }

    @kotlin.jvm.JvmSynthetic
    @kotlin.PublishedApi
    internal fun _build(): com.google.protobuf.Enum = _builder.build()

    /**
     * ```
     * Enum type name.
     * ```
     *
     * `string name = 1;`
     */
    public var name: kotlin.String
      @JvmName("getName")
      get() = _builder.getName()
      @JvmName("setName")
      set(value) {
        _builder.setName(value)
      }
    /**
     * ```
     * Enum type name.
     * ```
     *
     * `string name = 1;`
     */
    public fun clearName() {
      _builder.clearName()
    }

    /**
     * An uninstantiable, behaviorless type to represent the field in
     * generics.
     */
    @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
    public class EnumvalueProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     */
     public val enumvalue: com.google.protobuf.kotlin.DslList
      @kotlin.jvm.JvmSynthetic
      get() = com.google.protobuf.kotlin.DslList(
        _builder.getEnumvalueList()
      )
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     * @param value The enumvalue to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addEnumvalue")
    public fun com.google.protobuf.kotlin.DslList.add(value: com.google.protobuf.EnumValue) {
      _builder.addEnumvalue(value)
    }
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     * @param value The enumvalue to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignEnumvalue")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.protobuf.EnumValue) {
      add(value)
    }
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     * @param values The enumvalue to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addAllEnumvalue")
    public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
      _builder.addAllEnumvalue(values)
    }
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     * @param values The enumvalue to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignAllEnumvalue")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
      addAll(values)
    }
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     * @param index The index to set the value at.
     * @param value The enumvalue to set.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("setEnumvalue")
    public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.protobuf.EnumValue) {
      _builder.setEnumvalue(index, value)
    }
    /**
     * ```
     * Enum value definitions.
     * ```
     *
     * `repeated .google.protobuf.EnumValue enumvalue = 2;`
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("clearEnumvalue")
    public fun com.google.protobuf.kotlin.DslList.clear() {
      _builder.clearEnumvalue()
    }

    /**
     * An uninstantiable, behaviorless type to represent the field in
     * generics.
     */
    @kotlin.OptIn(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)
    public class OptionsProxy private constructor() : com.google.protobuf.kotlin.DslProxy()
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     */
     public val options: com.google.protobuf.kotlin.DslList
      @kotlin.jvm.JvmSynthetic
      get() = com.google.protobuf.kotlin.DslList(
        _builder.getOptionsList()
      )
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     * @param value The options to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addOptions")
    public fun com.google.protobuf.kotlin.DslList.add(value: com.google.protobuf.Option) {
      _builder.addOptions(value)
    }
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     * @param value The options to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignOptions")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(value: com.google.protobuf.Option) {
      add(value)
    }
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     * @param values The options to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("addAllOptions")
    public fun com.google.protobuf.kotlin.DslList.addAll(values: kotlin.collections.Iterable) {
      _builder.addAllOptions(values)
    }
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     * @param values The options to add.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("plusAssignAllOptions")
    @Suppress("NOTHING_TO_INLINE")
    public inline operator fun com.google.protobuf.kotlin.DslList.plusAssign(values: kotlin.collections.Iterable) {
      addAll(values)
    }
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     * @param index The index to set the value at.
     * @param value The options to set.
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("setOptions")
    public operator fun com.google.protobuf.kotlin.DslList.set(index: kotlin.Int, value: com.google.protobuf.Option) {
      _builder.setOptions(index, value)
    }
    /**
     * ```
     * Protocol buffer options.
     * ```
     *
     * `repeated .google.protobuf.Option options = 3;`
     */
    @kotlin.jvm.JvmSynthetic
    @kotlin.jvm.JvmName("clearOptions")
    public fun com.google.protobuf.kotlin.DslList.clear() {
      _builder.clearOptions()
    }

    /**
     * ```
     * The source context.
     * ```
     *
     * `.google.protobuf.SourceContext source_context = 4;`
     */
    public var sourceContext: com.google.protobuf.SourceContext
      @JvmName("getSourceContext")
      get() = _builder.getSourceContext()
      @JvmName("setSourceContext")
      set(value) {
        _builder.setSourceContext(value)
      }
    /**
     * ```
     * The source context.
     * ```
     *
     * `.google.protobuf.SourceContext source_context = 4;`
     */
    public fun clearSourceContext() {
      _builder.clearSourceContext()
    }
    /**
     * ```
     * The source context.
     * ```
     *
     * `.google.protobuf.SourceContext source_context = 4;`
     * @return Whether the sourceContext field is set.
     */
    public fun hasSourceContext(): kotlin.Boolean {
      return _builder.hasSourceContext()
    }

    /**
     * ```
     * The source syntax.
     * ```
     *
     * `.google.protobuf.Syntax syntax = 5;`
     */
    public var syntax: com.google.protobuf.Syntax
      @JvmName("getSyntax")
      get() = _builder.getSyntax()
      @JvmName("setSyntax")
      set(value) {
        _builder.setSyntax(value)
      }
    public var syntaxValue: kotlin.Int
      @JvmName("getSyntaxValue")
      get() = _builder.getSyntaxValue()
      @JvmName("setSyntaxValue")
      set(value) {
        _builder.setSyntaxValue(value)
      }
    /**
     * ```
     * The source syntax.
     * ```
     *
     * `.google.protobuf.Syntax syntax = 5;`
     */
    public fun clearSyntax() {
      _builder.clearSyntax()
    }

    /**
     * ```
     * The source edition string, only valid when syntax is SYNTAX_EDITIONS.
     * ```
     *
     * `string edition = 6;`
     */
    public var edition: kotlin.String
      @JvmName("getEdition")
      get() = _builder.getEdition()
      @JvmName("setEdition")
      set(value) {
        _builder.setEdition(value)
      }
    /**
     * ```
     * The source edition string, only valid when syntax is SYNTAX_EDITIONS.
     * ```
     *
     * `string edition = 6;`
     */
    public fun clearEdition() {
      _builder.clearEdition()
    }
  }
}
public inline fun com.google.protobuf.Enum.copy(block: com.google.protobuf.EnumKt.Dsl.() -> kotlin.Unit): com.google.protobuf.Enum =
  com.google.protobuf.EnumKt.Dsl._create(this.toBuilder()).apply { block() }._build()

public val com.google.protobuf.EnumOrBuilder.sourceContextOrNull: com.google.protobuf.SourceContext?
  get() = if (hasSourceContext()) getSourceContext() else null





© 2015 - 2024 Weber Informatics LLC | Privacy Policy