![JAR search and dependency download from the Maven repository](/logo.png)
edu.illinois.cs.cs125.questioner.lib.Question_ValidationResultsJsonAdapter.kt Maven / Gradle / Ivy
// 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 edu.illinois.cs.cs125.questioner.lib
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import com.squareup.moshi.`internal`.Util
import java.lang.NullPointerException
import java.lang.reflect.Constructor
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.emptySet
import kotlin.jvm.Volatile
import kotlin.text.buildString
public class Question_ValidationResultsJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("seed", "requiredTestCount",
"mutationCount", "solutionMaxRuntime", "bootstrapLength", "mutationLength", "incorrectLength",
"calibrationLength", "solutionCoverage", "executionCounts", "memoryAllocation",
"outputAmount", "solutionMaxClassSize", "canTestTest")
private val intAdapter: JsonAdapter = moshi.adapter(Int::class.java, emptySet(), "seed")
private val longAdapter: JsonAdapter = moshi.adapter(Long::class.java, emptySet(),
"bootstrapLength")
private val lineCoverageAdapter: JsonAdapter =
moshi.adapter(TestResults.CoverageComparison.LineCoverage::class.java, emptySet(),
"solutionCoverage")
private val languagesResourceUsageAdapter: JsonAdapter =
moshi.adapter(Question.LanguagesResourceUsage::class.java, emptySet(), "executionCounts")
private val nullableIntAdapter: JsonAdapter = moshi.adapter(Int::class.javaObjectType,
emptySet(), "outputAmount")
private val nullableLanguagesResourceUsageAdapter: JsonAdapter =
moshi.adapter(Question.LanguagesResourceUsage::class.java, emptySet(), "solutionMaxClassSize")
private val booleanAdapter: JsonAdapter = moshi.adapter(Boolean::class.java, emptySet(),
"canTestTest")
@Volatile
private var constructorRef: Constructor? = null
public override fun toString(): String = buildString(48) {
append("GeneratedJsonAdapter(").append("Question.ValidationResults").append(')') }
public override fun fromJson(reader: JsonReader): Question.ValidationResults {
var seed: Int? = null
var requiredTestCount: Int? = null
var mutationCount: Int? = null
var solutionMaxRuntime: Int? = null
var bootstrapLength: Long? = null
var mutationLength: Long? = null
var incorrectLength: Long? = null
var calibrationLength: Long? = null
var solutionCoverage: TestResults.CoverageComparison.LineCoverage? = null
var executionCounts: Question.LanguagesResourceUsage? = null
var memoryAllocation: Question.LanguagesResourceUsage? = null
var outputAmount: Int? = null
var solutionMaxClassSize: Question.LanguagesResourceUsage? = null
var canTestTest: Boolean? = false
var mask0 = -1
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> seed = intAdapter.fromJson(reader) ?: throw Util.unexpectedNull("seed", "seed", reader)
1 -> requiredTestCount = intAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("requiredTestCount", "requiredTestCount", reader)
2 -> mutationCount = intAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("mutationCount", "mutationCount", reader)
3 -> solutionMaxRuntime = intAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("solutionMaxRuntime", "solutionMaxRuntime", reader)
4 -> bootstrapLength = longAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("bootstrapLength", "bootstrapLength", reader)
5 -> mutationLength = longAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("mutationLength", "mutationLength", reader)
6 -> incorrectLength = longAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("incorrectLength", "incorrectLength", reader)
7 -> calibrationLength = longAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("calibrationLength", "calibrationLength", reader)
8 -> solutionCoverage = lineCoverageAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("solutionCoverage", "solutionCoverage", reader)
9 -> executionCounts = languagesResourceUsageAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("executionCounts", "executionCounts", reader)
10 -> memoryAllocation = languagesResourceUsageAdapter.fromJson(reader) ?:
throw Util.unexpectedNull("memoryAllocation", "memoryAllocation", reader)
11 -> {
outputAmount = nullableIntAdapter.fromJson(reader)
// $mask = $mask and (1 shl 11).inv()
mask0 = mask0 and 0xfffff7ff.toInt()
}
12 -> {
solutionMaxClassSize = nullableLanguagesResourceUsageAdapter.fromJson(reader)
// $mask = $mask and (1 shl 12).inv()
mask0 = mask0 and 0xffffefff.toInt()
}
13 -> {
canTestTest = booleanAdapter.fromJson(reader) ?: throw Util.unexpectedNull("canTestTest",
"canTestTest", reader)
// $mask = $mask and (1 shl 13).inv()
mask0 = mask0 and 0xffffdfff.toInt()
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
if (mask0 == 0xffffc7ff.toInt()) {
// All parameters with defaults are set, invoke the constructor directly
return Question.ValidationResults(
seed = seed ?: throw Util.missingProperty("seed", "seed", reader),
requiredTestCount = requiredTestCount ?: throw Util.missingProperty("requiredTestCount",
"requiredTestCount", reader),
mutationCount = mutationCount ?: throw Util.missingProperty("mutationCount",
"mutationCount", reader),
solutionMaxRuntime = solutionMaxRuntime ?:
throw Util.missingProperty("solutionMaxRuntime", "solutionMaxRuntime", reader),
bootstrapLength = bootstrapLength ?: throw Util.missingProperty("bootstrapLength",
"bootstrapLength", reader),
mutationLength = mutationLength ?: throw Util.missingProperty("mutationLength",
"mutationLength", reader),
incorrectLength = incorrectLength ?: throw Util.missingProperty("incorrectLength",
"incorrectLength", reader),
calibrationLength = calibrationLength ?: throw Util.missingProperty("calibrationLength",
"calibrationLength", reader),
solutionCoverage = solutionCoverage ?: throw Util.missingProperty("solutionCoverage",
"solutionCoverage", reader),
executionCounts = executionCounts ?: throw Util.missingProperty("executionCounts",
"executionCounts", reader),
memoryAllocation = memoryAllocation ?: throw Util.missingProperty("memoryAllocation",
"memoryAllocation", reader),
outputAmount = outputAmount,
solutionMaxClassSize = solutionMaxClassSize,
canTestTest = canTestTest as Boolean
)
} else {
// Reflectively invoke the synthetic defaults constructor
@Suppress("UNCHECKED_CAST")
val localConstructor: Constructor = this.constructorRef ?:
Question.ValidationResults::class.java.getDeclaredConstructor(Int::class.javaPrimitiveType,
Int::class.javaPrimitiveType, Int::class.javaPrimitiveType, Int::class.javaPrimitiveType,
Long::class.javaPrimitiveType, Long::class.javaPrimitiveType,
Long::class.javaPrimitiveType, Long::class.javaPrimitiveType,
TestResults.CoverageComparison.LineCoverage::class.java,
Question.LanguagesResourceUsage::class.java, Question.LanguagesResourceUsage::class.java,
Int::class.javaObjectType, Question.LanguagesResourceUsage::class.java,
Boolean::class.javaPrimitiveType, Int::class.javaPrimitiveType,
Util.DEFAULT_CONSTRUCTOR_MARKER).also { this.constructorRef = it }
return localConstructor.newInstance(
seed ?: throw Util.missingProperty("seed", "seed", reader),
requiredTestCount ?: throw Util.missingProperty("requiredTestCount", "requiredTestCount",
reader),
mutationCount ?: throw Util.missingProperty("mutationCount", "mutationCount", reader),
solutionMaxRuntime ?: throw Util.missingProperty("solutionMaxRuntime",
"solutionMaxRuntime", reader),
bootstrapLength ?: throw Util.missingProperty("bootstrapLength", "bootstrapLength",
reader),
mutationLength ?: throw Util.missingProperty("mutationLength", "mutationLength", reader),
incorrectLength ?: throw Util.missingProperty("incorrectLength", "incorrectLength",
reader),
calibrationLength ?: throw Util.missingProperty("calibrationLength", "calibrationLength",
reader),
solutionCoverage ?: throw Util.missingProperty("solutionCoverage", "solutionCoverage",
reader),
executionCounts ?: throw Util.missingProperty("executionCounts", "executionCounts",
reader),
memoryAllocation ?: throw Util.missingProperty("memoryAllocation", "memoryAllocation",
reader),
outputAmount,
solutionMaxClassSize,
canTestTest,
mask0,
/* DefaultConstructorMarker */ null
)
}
}
public override fun toJson(writer: JsonWriter, value_: Question.ValidationResults?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("seed")
intAdapter.toJson(writer, value_.seed)
writer.name("requiredTestCount")
intAdapter.toJson(writer, value_.requiredTestCount)
writer.name("mutationCount")
intAdapter.toJson(writer, value_.mutationCount)
writer.name("solutionMaxRuntime")
intAdapter.toJson(writer, value_.solutionMaxRuntime)
writer.name("bootstrapLength")
longAdapter.toJson(writer, value_.bootstrapLength)
writer.name("mutationLength")
longAdapter.toJson(writer, value_.mutationLength)
writer.name("incorrectLength")
longAdapter.toJson(writer, value_.incorrectLength)
writer.name("calibrationLength")
longAdapter.toJson(writer, value_.calibrationLength)
writer.name("solutionCoverage")
lineCoverageAdapter.toJson(writer, value_.solutionCoverage)
writer.name("executionCounts")
languagesResourceUsageAdapter.toJson(writer, value_.executionCounts)
writer.name("memoryAllocation")
languagesResourceUsageAdapter.toJson(writer, value_.memoryAllocation)
writer.name("outputAmount")
nullableIntAdapter.toJson(writer, value_.outputAmount)
writer.name("solutionMaxClassSize")
nullableLanguagesResourceUsageAdapter.toJson(writer, value_.solutionMaxClassSize)
writer.name("canTestTest")
booleanAdapter.toJson(writer, value_.canTestTest)
writer.endObject()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy