de.gesellix.docker.remote.api.ImageInspectJsonAdapter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docker-remote-api-model-1-45 Show documentation
Show all versions of docker-remote-api-model-1-45 Show documentation
API model for the Docker remote api v1.45
// 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.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.MutableList
import kotlin.collections.emptySet
import kotlin.jvm.Volatile
import kotlin.text.buildString
public class ImageInspectJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("Id", "RepoTags", "RepoDigests",
"Parent", "Comment", "Created", "Container", "ContainerConfig", "DockerVersion", "Author",
"Config", "Architecture", "Variant", "Os", "OsVersion", "Size", "VirtualSize", "GraphDriver",
"RootFS", "Metadata")
private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
emptySet(), "id")
private val nullableMutableListOfStringAdapter: JsonAdapter?> =
moshi.adapter(Types.newParameterizedType(MutableList::class.java, String::class.java),
emptySet(), "repoTags")
private val nullableContainerConfigAdapter: JsonAdapter =
moshi.adapter(ContainerConfig::class.java, emptySet(), "containerConfig")
private val nullableLongAdapter: JsonAdapter = moshi.adapter(Long::class.javaObjectType,
emptySet(), "propertySize")
private val nullableGraphDriverDataAdapter: JsonAdapter =
moshi.adapter(GraphDriverData::class.java, emptySet(), "graphDriver")
private val nullableImageInspectRootFSAdapter: JsonAdapter =
moshi.adapter(ImageInspectRootFS::class.java, emptySet(), "rootFS")
private val nullableImageInspectMetadataAdapter: JsonAdapter =
moshi.adapter(ImageInspectMetadata::class.java, emptySet(), "metadata")
@Volatile
private var constructorRef: Constructor? = null
public override fun toString(): String = buildString(34) {
append("GeneratedJsonAdapter(").append("ImageInspect").append(')') }
public override fun fromJson(reader: JsonReader): ImageInspect {
var id: String? = null
var repoTags: MutableList? = null
var repoDigests: MutableList? = null
var parent: String? = null
var comment: String? = null
var created: String? = null
var container: String? = null
var containerConfig: ContainerConfig? = null
var dockerVersion: String? = null
var author: String? = null
var config: ContainerConfig? = null
var architecture: String? = null
var variant: String? = null
var os: String? = null
var osVersion: String? = null
var propertySize: Long? = null
var virtualSize: Long? = null
var graphDriver: GraphDriverData? = null
var rootFS: ImageInspectRootFS? = null
var metadata: ImageInspectMetadata? = null
var mask0 = -1
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> {
id = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 0).inv()
mask0 = mask0 and 0xfffffffe.toInt()
}
1 -> {
repoTags = nullableMutableListOfStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 1).inv()
mask0 = mask0 and 0xfffffffd.toInt()
}
2 -> {
repoDigests = nullableMutableListOfStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 2).inv()
mask0 = mask0 and 0xfffffffb.toInt()
}
3 -> {
parent = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 3).inv()
mask0 = mask0 and 0xfffffff7.toInt()
}
4 -> {
comment = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 4).inv()
mask0 = mask0 and 0xffffffef.toInt()
}
5 -> {
created = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 5).inv()
mask0 = mask0 and 0xffffffdf.toInt()
}
6 -> {
container = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 6).inv()
mask0 = mask0 and 0xffffffbf.toInt()
}
7 -> {
containerConfig = nullableContainerConfigAdapter.fromJson(reader)
// $mask = $mask and (1 shl 7).inv()
mask0 = mask0 and 0xffffff7f.toInt()
}
8 -> {
dockerVersion = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 8).inv()
mask0 = mask0 and 0xfffffeff.toInt()
}
9 -> {
author = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 9).inv()
mask0 = mask0 and 0xfffffdff.toInt()
}
10 -> {
config = nullableContainerConfigAdapter.fromJson(reader)
// $mask = $mask and (1 shl 10).inv()
mask0 = mask0 and 0xfffffbff.toInt()
}
11 -> {
architecture = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 11).inv()
mask0 = mask0 and 0xfffff7ff.toInt()
}
12 -> {
variant = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 12).inv()
mask0 = mask0 and 0xffffefff.toInt()
}
13 -> {
os = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 13).inv()
mask0 = mask0 and 0xffffdfff.toInt()
}
14 -> {
osVersion = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 14).inv()
mask0 = mask0 and 0xffffbfff.toInt()
}
15 -> {
propertySize = nullableLongAdapter.fromJson(reader)
// $mask = $mask and (1 shl 15).inv()
mask0 = mask0 and 0xffff7fff.toInt()
}
16 -> {
virtualSize = nullableLongAdapter.fromJson(reader)
// $mask = $mask and (1 shl 16).inv()
mask0 = mask0 and 0xfffeffff.toInt()
}
17 -> {
graphDriver = nullableGraphDriverDataAdapter.fromJson(reader)
// $mask = $mask and (1 shl 17).inv()
mask0 = mask0 and 0xfffdffff.toInt()
}
18 -> {
rootFS = nullableImageInspectRootFSAdapter.fromJson(reader)
// $mask = $mask and (1 shl 18).inv()
mask0 = mask0 and 0xfffbffff.toInt()
}
19 -> {
metadata = nullableImageInspectMetadataAdapter.fromJson(reader)
// $mask = $mask and (1 shl 19).inv()
mask0 = mask0 and 0xfff7ffff.toInt()
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
if (mask0 == 0xfff00000.toInt()) {
// All parameters with defaults are set, invoke the constructor directly
return ImageInspect(
id = id,
repoTags = repoTags,
repoDigests = repoDigests,
parent = parent,
comment = comment,
created = created,
container = container,
containerConfig = containerConfig,
dockerVersion = dockerVersion,
author = author,
config = config,
architecture = architecture,
variant = variant,
os = os,
osVersion = osVersion,
propertySize = propertySize,
virtualSize = virtualSize,
graphDriver = graphDriver,
rootFS = rootFS,
metadata = metadata
)
} else {
// Reflectively invoke the synthetic defaults constructor
@Suppress("UNCHECKED_CAST")
val localConstructor: Constructor = this.constructorRef ?:
ImageInspect::class.java.getDeclaredConstructor(String::class.java,
MutableList::class.java, MutableList::class.java, String::class.java, String::class.java,
String::class.java, String::class.java, ContainerConfig::class.java, String::class.java,
String::class.java, ContainerConfig::class.java, String::class.java, String::class.java,
String::class.java, String::class.java, Long::class.javaObjectType,
Long::class.javaObjectType, GraphDriverData::class.java, ImageInspectRootFS::class.java,
ImageInspectMetadata::class.java, Int::class.javaPrimitiveType,
Util.DEFAULT_CONSTRUCTOR_MARKER).also { this.constructorRef = it }
return localConstructor.newInstance(
id,
repoTags,
repoDigests,
parent,
comment,
created,
container,
containerConfig,
dockerVersion,
author,
config,
architecture,
variant,
os,
osVersion,
propertySize,
virtualSize,
graphDriver,
rootFS,
metadata,
mask0,
/* DefaultConstructorMarker */ null
)
}
}
public override fun toJson(writer: JsonWriter, value_: ImageInspect?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("Id")
nullableStringAdapter.toJson(writer, value_.id)
writer.name("RepoTags")
nullableMutableListOfStringAdapter.toJson(writer, value_.repoTags)
writer.name("RepoDigests")
nullableMutableListOfStringAdapter.toJson(writer, value_.repoDigests)
writer.name("Parent")
nullableStringAdapter.toJson(writer, value_.parent)
writer.name("Comment")
nullableStringAdapter.toJson(writer, value_.comment)
writer.name("Created")
nullableStringAdapter.toJson(writer, value_.created)
writer.name("Container")
nullableStringAdapter.toJson(writer, value_.container)
writer.name("ContainerConfig")
nullableContainerConfigAdapter.toJson(writer, value_.containerConfig)
writer.name("DockerVersion")
nullableStringAdapter.toJson(writer, value_.dockerVersion)
writer.name("Author")
nullableStringAdapter.toJson(writer, value_.author)
writer.name("Config")
nullableContainerConfigAdapter.toJson(writer, value_.config)
writer.name("Architecture")
nullableStringAdapter.toJson(writer, value_.architecture)
writer.name("Variant")
nullableStringAdapter.toJson(writer, value_.variant)
writer.name("Os")
nullableStringAdapter.toJson(writer, value_.os)
writer.name("OsVersion")
nullableStringAdapter.toJson(writer, value_.osVersion)
writer.name("Size")
nullableLongAdapter.toJson(writer, value_.propertySize)
writer.name("VirtualSize")
nullableLongAdapter.toJson(writer, value_.virtualSize)
writer.name("GraphDriver")
nullableGraphDriverDataAdapter.toJson(writer, value_.graphDriver)
writer.name("RootFS")
nullableImageInspectRootFSAdapter.toJson(writer, value_.rootFS)
writer.name("Metadata")
nullableImageInspectMetadataAdapter.toJson(writer, value_.metadata)
writer.endObject()
}
}