wire-runtime / com.squareup.wire.internal / Internal

Internal

class Internal

Methods for generated code use only. Not subject to public API rules.

Functions

checkElementsNotNull

static fun checkElementsNotNull(list: MutableList<*>): Unit

Throw NullPointerException if list or one of its items are null.

static fun checkElementsNotNull(map: MutableMap<*, *>): Unit

Throw NullPointerException if map or one of its keys or values are null.

copyOf

static fun <T : Any> copyOf(name: String, list: MutableList<T>): MutableList<T>
static fun <K : Any, V : Any> copyOf(name: String, map: MutableMap<K, V>): MutableMap<K, V>

countNonNull

static fun countNonNull(a: Any, b: Any): Int

Returns the number of non-null values in a, b.

static fun countNonNull(a: Any, b: Any, c: Any): Int

Returns the number of non-null values in a, b, c.

static fun countNonNull(a: Any, b: Any, c: Any, d: Any, vararg rest: Any): Int

Returns the number of non-null values in a, b, c, d, rest.

equals

static fun equals(a: Any, b: Any): Boolean

immutableCopyOf

static fun <T : Any> immutableCopyOf(name: String, list: MutableList<T>): MutableList<T>
static fun <K : Any, V : Any> immutableCopyOf(name: String, map: MutableMap<K, V>): MutableMap<K, V>

missingRequiredFields

static fun missingRequiredFields(vararg args: Any): IllegalStateException

Create an exception for missing required fields.

newMutableList

static fun <T : Any> newMutableList(): MutableList<T>

newMutableMap

static fun <K : Any, V : Any> newMutableMap(): MutableMap<K, V>

redactElements

static fun <T : Any> redactElements(list: MutableList<T>, adapter: ProtoAdapter<T>): Unit
static fun <T : Any> redactElements(map: MutableMap<*, T>, adapter: ProtoAdapter<T>): Unit