TMapField.java
/**
* Autogenerated by Thrift Compiler (0.16.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.doris.thrift.schema.external;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class TMapField implements org.apache.thrift.TBase<TMapField, TMapField._Fields>, java.io.Serializable, Cloneable, Comparable<TMapField> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapField");
private static final org.apache.thrift.protocol.TField KEY_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("key_field", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("value_field", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TMapFieldStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TMapFieldTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable TFieldPtr key_field; // optional
public @org.apache.thrift.annotation.Nullable TFieldPtr value_field; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
KEY_FIELD((short)1, "key_field"),
VALUE_FIELD((short)2, "value_field");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // KEY_FIELD
return KEY_FIELD;
case 2: // VALUE_FIELD
return VALUE_FIELD;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.KEY_FIELD,_Fields.VALUE_FIELD};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.KEY_FIELD, new org.apache.thrift.meta_data.FieldMetaData("key_field", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFieldPtr.class)));
tmpMap.put(_Fields.VALUE_FIELD, new org.apache.thrift.meta_data.FieldMetaData("value_field", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFieldPtr.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapField.class, metaDataMap);
}
public TMapField() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TMapField(TMapField other) {
if (other.isSetKeyField()) {
this.key_field = new TFieldPtr(other.key_field);
}
if (other.isSetValueField()) {
this.value_field = new TFieldPtr(other.value_field);
}
}
public TMapField deepCopy() {
return new TMapField(this);
}
@Override
public void clear() {
this.key_field = null;
this.value_field = null;
}
@org.apache.thrift.annotation.Nullable
public TFieldPtr getKeyField() {
return this.key_field;
}
public TMapField setKeyField(@org.apache.thrift.annotation.Nullable TFieldPtr key_field) {
this.key_field = key_field;
return this;
}
public void unsetKeyField() {
this.key_field = null;
}
/** Returns true if field key_field is set (has been assigned a value) and false otherwise */
public boolean isSetKeyField() {
return this.key_field != null;
}
public void setKeyFieldIsSet(boolean value) {
if (!value) {
this.key_field = null;
}
}
@org.apache.thrift.annotation.Nullable
public TFieldPtr getValueField() {
return this.value_field;
}
public TMapField setValueField(@org.apache.thrift.annotation.Nullable TFieldPtr value_field) {
this.value_field = value_field;
return this;
}
public void unsetValueField() {
this.value_field = null;
}
/** Returns true if field value_field is set (has been assigned a value) and false otherwise */
public boolean isSetValueField() {
return this.value_field != null;
}
public void setValueFieldIsSet(boolean value) {
if (!value) {
this.value_field = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case KEY_FIELD:
if (value == null) {
unsetKeyField();
} else {
setKeyField((TFieldPtr)value);
}
break;
case VALUE_FIELD:
if (value == null) {
unsetValueField();
} else {
setValueField((TFieldPtr)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case KEY_FIELD:
return getKeyField();
case VALUE_FIELD:
return getValueField();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case KEY_FIELD:
return isSetKeyField();
case VALUE_FIELD:
return isSetValueField();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TMapField)
return this.equals((TMapField)that);
return false;
}
public boolean equals(TMapField that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_key_field = true && this.isSetKeyField();
boolean that_present_key_field = true && that.isSetKeyField();
if (this_present_key_field || that_present_key_field) {
if (!(this_present_key_field && that_present_key_field))
return false;
if (!this.key_field.equals(that.key_field))
return false;
}
boolean this_present_value_field = true && this.isSetValueField();
boolean that_present_value_field = true && that.isSetValueField();
if (this_present_value_field || that_present_value_field) {
if (!(this_present_value_field && that_present_value_field))
return false;
if (!this.value_field.equals(that.value_field))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetKeyField()) ? 131071 : 524287);
if (isSetKeyField())
hashCode = hashCode * 8191 + key_field.hashCode();
hashCode = hashCode * 8191 + ((isSetValueField()) ? 131071 : 524287);
if (isSetValueField())
hashCode = hashCode * 8191 + value_field.hashCode();
return hashCode;
}
@Override
public int compareTo(TMapField other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetKeyField(), other.isSetKeyField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetKeyField()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key_field, other.key_field);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetValueField(), other.isSetValueField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetValueField()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value_field, other.value_field);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("TMapField(");
boolean first = true;
if (isSetKeyField()) {
sb.append("key_field:");
if (this.key_field == null) {
sb.append("null");
} else {
sb.append(this.key_field);
}
first = false;
}
if (isSetValueField()) {
if (!first) sb.append(", ");
sb.append("value_field:");
if (this.value_field == null) {
sb.append("null");
} else {
sb.append(this.value_field);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (key_field != null) {
key_field.validate();
}
if (value_field != null) {
value_field.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TMapFieldStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TMapFieldStandardScheme getScheme() {
return new TMapFieldStandardScheme();
}
}
private static class TMapFieldStandardScheme extends org.apache.thrift.scheme.StandardScheme<TMapField> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TMapField struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // KEY_FIELD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.key_field = new TFieldPtr();
struct.key_field.read(iprot);
struct.setKeyFieldIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // VALUE_FIELD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.value_field = new TFieldPtr();
struct.value_field.read(iprot);
struct.setValueFieldIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TMapField struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.key_field != null) {
if (struct.isSetKeyField()) {
oprot.writeFieldBegin(KEY_FIELD_FIELD_DESC);
struct.key_field.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.value_field != null) {
if (struct.isSetValueField()) {
oprot.writeFieldBegin(VALUE_FIELD_FIELD_DESC);
struct.value_field.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TMapFieldTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TMapFieldTupleScheme getScheme() {
return new TMapFieldTupleScheme();
}
}
private static class TMapFieldTupleScheme extends org.apache.thrift.scheme.TupleScheme<TMapField> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TMapField struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetKeyField()) {
optionals.set(0);
}
if (struct.isSetValueField()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetKeyField()) {
struct.key_field.write(oprot);
}
if (struct.isSetValueField()) {
struct.value_field.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TMapField struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.key_field = new TFieldPtr();
struct.key_field.read(iprot);
struct.setKeyFieldIsSet(true);
}
if (incoming.get(1)) {
struct.value_field = new TFieldPtr();
struct.value_field.read(iprot);
struct.setValueFieldIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}