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

de.gesellix.docker.remote.api.ContainerConfigJsonAdapter.kt Maven / Gradle / Ivy

There is a newer version: 2024-11-04T20-53-00
Show newest version
// Code generated by moshi-kotlin-codegen. Do not edit.
@file:Suppress("DEPRECATION", "unused", "UNUSED_PARAMETER", "ClassName", "REDUNDANT_PROJECTION",
    "RedundantExplicitType", "LocalVariableName", "RedundantVisibilityModifier",
    "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION")

package de.gesellix.docker.remote.api

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types
import com.squareup.moshi.`internal`.Util
import java.lang.NullPointerException
import java.lang.reflect.Constructor
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.MutableList
import kotlin.collections.MutableMap
import kotlin.collections.emptySet
import kotlin.jvm.Volatile
import kotlin.text.buildString

public class ContainerConfigJsonAdapter(
  moshi: Moshi,
) : JsonAdapter() {
  private val options: JsonReader.Options = JsonReader.Options.of("Hostname", "Domainname", "User",
      "AttachStdin", "AttachStdout", "AttachStderr", "ExposedPorts", "Tty", "OpenStdin",
      "StdinOnce", "Env", "Cmd", "Healthcheck", "ArgsEscaped", "Image", "Volumes", "WorkingDir",
      "Entrypoint", "NetworkDisabled", "MacAddress", "OnBuild", "Labels", "StopSignal",
      "StopTimeout", "Shell")

  private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
      emptySet(), "hostname")

  private val nullableBooleanAdapter: JsonAdapter =
      moshi.adapter(Boolean::class.javaObjectType, emptySet(), "attachStdin")

  private val nullableMutableMapOfStringAnyAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableMap::class.java, String::class.java,
      Any::class.java), emptySet(), "exposedPorts")

  private val nullableMutableListOfStringAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java, String::class.java),
      emptySet(), "env")

  private val nullableHealthConfigAdapter: JsonAdapter =
      moshi.adapter(HealthConfig::class.java, emptySet(), "healthcheck")

  private val nullableMutableMapOfStringStringAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableMap::class.java, String::class.java,
      String::class.java), emptySet(), "labels")

  private val nullableIntAdapter: JsonAdapter = moshi.adapter(Int::class.javaObjectType,
      emptySet(), "stopTimeout")

  @Volatile
  private var constructorRef: Constructor? = null

  public override fun toString(): String = buildString(37) {
      append("GeneratedJsonAdapter(").append("ContainerConfig").append(')') }

  public override fun fromJson(reader: JsonReader): ContainerConfig {
    var hostname: String? = null
    var domainname: String? = null
    var user: String? = null
    var attachStdin: Boolean? = null
    var attachStdout: Boolean? = null
    var attachStderr: Boolean? = null
    var exposedPorts: MutableMap? = null
    var tty: Boolean? = null
    var openStdin: Boolean? = null
    var stdinOnce: Boolean? = null
    var env: MutableList? = null
    var cmd: MutableList? = null
    var healthcheck: HealthConfig? = null
    var argsEscaped: Boolean? = null
    var image: String? = null
    var volumes: MutableMap? = null
    var workingDir: String? = null
    var entrypoint: MutableList? = null
    var networkDisabled: Boolean? = null
    var macAddress: String? = null
    var onBuild: MutableList? = null
    var labels: MutableMap? = null
    var stopSignal: String? = null
    var stopTimeout: Int? = null
    var shell: MutableList? = null
    var mask0 = -1
    reader.beginObject()
    while (reader.hasNext()) {
      when (reader.selectName(options)) {
        0 -> {
          hostname = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 0).inv()
          mask0 = mask0 and 0xfffffffe.toInt()
        }
        1 -> {
          domainname = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 1).inv()
          mask0 = mask0 and 0xfffffffd.toInt()
        }
        2 -> {
          user = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 2).inv()
          mask0 = mask0 and 0xfffffffb.toInt()
        }
        3 -> {
          attachStdin = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 3).inv()
          mask0 = mask0 and 0xfffffff7.toInt()
        }
        4 -> {
          attachStdout = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 4).inv()
          mask0 = mask0 and 0xffffffef.toInt()
        }
        5 -> {
          attachStderr = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 5).inv()
          mask0 = mask0 and 0xffffffdf.toInt()
        }
        6 -> {
          exposedPorts = nullableMutableMapOfStringAnyAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 6).inv()
          mask0 = mask0 and 0xffffffbf.toInt()
        }
        7 -> {
          tty = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 7).inv()
          mask0 = mask0 and 0xffffff7f.toInt()
        }
        8 -> {
          openStdin = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 8).inv()
          mask0 = mask0 and 0xfffffeff.toInt()
        }
        9 -> {
          stdinOnce = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 9).inv()
          mask0 = mask0 and 0xfffffdff.toInt()
        }
        10 -> {
          env = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 10).inv()
          mask0 = mask0 and 0xfffffbff.toInt()
        }
        11 -> {
          cmd = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 11).inv()
          mask0 = mask0 and 0xfffff7ff.toInt()
        }
        12 -> {
          healthcheck = nullableHealthConfigAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 12).inv()
          mask0 = mask0 and 0xffffefff.toInt()
        }
        13 -> {
          argsEscaped = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 13).inv()
          mask0 = mask0 and 0xffffdfff.toInt()
        }
        14 -> {
          image = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 14).inv()
          mask0 = mask0 and 0xffffbfff.toInt()
        }
        15 -> {
          volumes = nullableMutableMapOfStringAnyAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 15).inv()
          mask0 = mask0 and 0xffff7fff.toInt()
        }
        16 -> {
          workingDir = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 16).inv()
          mask0 = mask0 and 0xfffeffff.toInt()
        }
        17 -> {
          entrypoint = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 17).inv()
          mask0 = mask0 and 0xfffdffff.toInt()
        }
        18 -> {
          networkDisabled = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 18).inv()
          mask0 = mask0 and 0xfffbffff.toInt()
        }
        19 -> {
          macAddress = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 19).inv()
          mask0 = mask0 and 0xfff7ffff.toInt()
        }
        20 -> {
          onBuild = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 20).inv()
          mask0 = mask0 and 0xffefffff.toInt()
        }
        21 -> {
          labels = nullableMutableMapOfStringStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 21).inv()
          mask0 = mask0 and 0xffdfffff.toInt()
        }
        22 -> {
          stopSignal = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 22).inv()
          mask0 = mask0 and 0xffbfffff.toInt()
        }
        23 -> {
          stopTimeout = nullableIntAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 23).inv()
          mask0 = mask0 and 0xff7fffff.toInt()
        }
        24 -> {
          shell = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 24).inv()
          mask0 = mask0 and 0xfeffffff.toInt()
        }
        -1 -> {
          // Unknown name, skip it.
          reader.skipName()
          reader.skipValue()
        }
      }
    }
    reader.endObject()
    if (mask0 == 0xfe000000.toInt()) {
      // All parameters with defaults are set, invoke the constructor directly
      return  ContainerConfig(
          hostname = hostname,
          domainname = domainname,
          user = user,
          attachStdin = attachStdin,
          attachStdout = attachStdout,
          attachStderr = attachStderr,
          exposedPorts = exposedPorts,
          tty = tty,
          openStdin = openStdin,
          stdinOnce = stdinOnce,
          env = env,
          cmd = cmd,
          healthcheck = healthcheck,
          argsEscaped = argsEscaped,
          image = image,
          volumes = volumes,
          workingDir = workingDir,
          entrypoint = entrypoint,
          networkDisabled = networkDisabled,
          macAddress = macAddress,
          onBuild = onBuild,
          labels = labels,
          stopSignal = stopSignal,
          stopTimeout = stopTimeout,
          shell = shell
      )
    } else {
      // Reflectively invoke the synthetic defaults constructor
      @Suppress("UNCHECKED_CAST")
      val localConstructor: Constructor = this.constructorRef ?:
          ContainerConfig::class.java.getDeclaredConstructor(String::class.java, String::class.java,
          String::class.java, Boolean::class.javaObjectType, Boolean::class.javaObjectType,
          Boolean::class.javaObjectType, MutableMap::class.java, Boolean::class.javaObjectType,
          Boolean::class.javaObjectType, Boolean::class.javaObjectType, MutableList::class.java,
          MutableList::class.java, HealthConfig::class.java, Boolean::class.javaObjectType,
          String::class.java, MutableMap::class.java, String::class.java, MutableList::class.java,
          Boolean::class.javaObjectType, String::class.java, MutableList::class.java,
          MutableMap::class.java, String::class.java, Int::class.javaObjectType,
          MutableList::class.java, Int::class.javaPrimitiveType,
          Util.DEFAULT_CONSTRUCTOR_MARKER).also { this.constructorRef = it }
      return localConstructor.newInstance(
          hostname,
          domainname,
          user,
          attachStdin,
          attachStdout,
          attachStderr,
          exposedPorts,
          tty,
          openStdin,
          stdinOnce,
          env,
          cmd,
          healthcheck,
          argsEscaped,
          image,
          volumes,
          workingDir,
          entrypoint,
          networkDisabled,
          macAddress,
          onBuild,
          labels,
          stopSignal,
          stopTimeout,
          shell,
          mask0,
          /* DefaultConstructorMarker */ null
      )
    }
  }

  public override fun toJson(writer: JsonWriter, value_: ContainerConfig?): Unit {
    if (value_ == null) {
      throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
    }
    writer.beginObject()
    writer.name("Hostname")
    nullableStringAdapter.toJson(writer, value_.hostname)
    writer.name("Domainname")
    nullableStringAdapter.toJson(writer, value_.domainname)
    writer.name("User")
    nullableStringAdapter.toJson(writer, value_.user)
    writer.name("AttachStdin")
    nullableBooleanAdapter.toJson(writer, value_.attachStdin)
    writer.name("AttachStdout")
    nullableBooleanAdapter.toJson(writer, value_.attachStdout)
    writer.name("AttachStderr")
    nullableBooleanAdapter.toJson(writer, value_.attachStderr)
    writer.name("ExposedPorts")
    nullableMutableMapOfStringAnyAdapter.toJson(writer, value_.exposedPorts)
    writer.name("Tty")
    nullableBooleanAdapter.toJson(writer, value_.tty)
    writer.name("OpenStdin")
    nullableBooleanAdapter.toJson(writer, value_.openStdin)
    writer.name("StdinOnce")
    nullableBooleanAdapter.toJson(writer, value_.stdinOnce)
    writer.name("Env")
    nullableMutableListOfStringAdapter.toJson(writer, value_.env)
    writer.name("Cmd")
    nullableMutableListOfStringAdapter.toJson(writer, value_.cmd)
    writer.name("Healthcheck")
    nullableHealthConfigAdapter.toJson(writer, value_.healthcheck)
    writer.name("ArgsEscaped")
    nullableBooleanAdapter.toJson(writer, value_.argsEscaped)
    writer.name("Image")
    nullableStringAdapter.toJson(writer, value_.image)
    writer.name("Volumes")
    nullableMutableMapOfStringAnyAdapter.toJson(writer, value_.volumes)
    writer.name("WorkingDir")
    nullableStringAdapter.toJson(writer, value_.workingDir)
    writer.name("Entrypoint")
    nullableMutableListOfStringAdapter.toJson(writer, value_.entrypoint)
    writer.name("NetworkDisabled")
    nullableBooleanAdapter.toJson(writer, value_.networkDisabled)
    writer.name("MacAddress")
    nullableStringAdapter.toJson(writer, value_.macAddress)
    writer.name("OnBuild")
    nullableMutableListOfStringAdapter.toJson(writer, value_.onBuild)
    writer.name("Labels")
    nullableMutableMapOfStringStringAdapter.toJson(writer, value_.labels)
    writer.name("StopSignal")
    nullableStringAdapter.toJson(writer, value_.stopSignal)
    writer.name("StopTimeout")
    nullableIntAdapter.toJson(writer, value_.stopTimeout)
    writer.name("Shell")
    nullableMutableListOfStringAdapter.toJson(writer, value_.shell)
    writer.endObject()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy