Package com.google.protobuf.kotlin

//protobuf-kotlin/com.google.protobuf.kotlin

Types

NameSummary
DslList[JVM]
Content
class DslList<E, P : DslProxy>constructor(delegate: List<E>) : List<E>
A simple wrapper around a List with an extra generic parameter that can be used to disambiguate extension methods.


DslMap[JVM]
Content
class DslMap<K, V, P : DslProxy>constructor(delegate: Map<K, V>) : Map<K, V>
A simple wrapper around a Map with an extra generic parameter that can be used to disambiguate extension methods.


DslProxy[JVM]
Content
abstract class DslProxy
A type meaningful only for its existence, never intended to be instantiated.


ExtensionList[JVM]
Content
class ExtensionList<E, M : MessageLite>constructor(extension: ExtensionLite<M, List<E», delegate: List<E>) : List<E>
Implementation for ExtensionList and ExtensionListLite.


OnlyForUseByGeneratedProtoCode[JVM]
Content
@Target(allowedTargets = [AnnotationTarget.CONSTRUCTOR, AnnotationTarget.ANNOTATION_CLASS])

annotation class OnlyForUseByGeneratedProtoCode
Opt-in annotation to make it difficult to accidentally use APIs only intended for use by proto generated code.


ProtoDslMarker[JVM]
Content
@DslMarker()
@Target(allowedTargets = [AnnotationTarget.CLASS])

annotation class ProtoDslMarker
Indicates an API that is part of a DSL to generate protocol buffer messages.


Functions

NameSummary
contains[JVM]
Content
operator fun <M : GeneratedMessageV3.ExtendableMessage<M>, MorBT : GeneratedMessageV3.ExtendableMessageOrBuilder<M» MorBT.contains(extension: ExtensionLite<M, *>): Boolean
Returns true if the specified extension is set on this builder.


get[JVM]
Content
operator fun <M : GeneratedMessageV3.ExtendableMessage<M>, MorBT : GeneratedMessageV3.ExtendableMessageOrBuilder<M>, T : Any> MorBT.get(extension: ExtensionLite<M, T>): T
Gets the current value of the proto extension.


[JVM]
Content
operator fun ByteString.get(index: Int): Byte
Gets the byte at index.


isA[JVM]
Content
inline fun <T : Message> Any.isA(): Boolean
Returns true if this com.google.protobuf.Any contains a message of type T.


plus[JVM]
Content
operator fun ByteString.plus(other: ByteString): ByteString
Concatenates the given ByteString to this one.


set[JVM]
Content
operator fun <M : GeneratedMessageV3.ExtendableMessage<M>, B : GeneratedMessageV3.ExtendableBuilder<M, B>, T : Any> B.set(extension: ExtensionLite<M, T>, value: T)
Sets the current value of the proto extension in this builder.


toByteString[JVM]
Content
fun ByteBuffer.toByteString(): ByteString
Copies the remaining bytes from this ByteBuffer to a ByteString.


[JVM]
Content
fun ByteArray.toByteString(): ByteString
Returns a copy of this ByteArray as an immutable ByteString.


toByteStringUtf8[JVM]
Content
fun String.toByteStringUtf8(): ByteString
Encodes this String into a sequence of UTF-8 bytes and returns the result as a ByteString.


unpack[JVM]
Content
inline fun <T : Message> Any.unpack(): T
Returns the message of type T encoded in this com.google.protobuf.Any.