in thrifty-runtime/src/commonTest/kotlin/com/microsoft/thrifty/protocol/Xtruct.kt [190:254]
override fun read(protocol: Protocol, builder: Builder): Xtruct {
protocol.readStructBegin()
while (true) {
val field = protocol.readFieldBegin()
if (field.typeId == TType.STOP) {
break
}
when (field.fieldId.toInt()) {
1 -> {
if (field.typeId == TType.STRING) {
val value = protocol.readString()
builder.string_thing(value)
} else {
skip(protocol, field.typeId)
}
}
4 -> {
if (field.typeId == TType.BYTE) {
val value = protocol.readByte()
builder.byte_thing(value)
} else {
skip(protocol, field.typeId)
}
}
9 -> {
if (field.typeId == TType.I32) {
val value = protocol.readI32()
builder.i32_thing(value)
} else {
skip(protocol, field.typeId)
}
}
11 -> {
if (field.typeId == TType.I64) {
val value = protocol.readI64()
builder.i64_thing(value)
} else {
skip(protocol, field.typeId)
}
}
13 -> {
if (field.typeId == TType.DOUBLE) {
val value = protocol.readDouble()
builder.double_thing(value)
} else {
skip(protocol, field.typeId)
}
}
15 -> {
if (field.typeId == TType.BOOL) {
val value = protocol.readBool()
builder.bool_thing(value)
} else {
skip(protocol, field.typeId)
}
}
else -> {
skip(protocol, field.typeId)
}
}
protocol.readFieldEnd()
}
protocol.readStructEnd()
return builder.build()
}