woody 2 migration (#29)

* woody 2 migration

* woody 2 migration
This commit is contained in:
Anatolii Karlov 2024-06-24 21:12:24 +07:00 committed by GitHub
parent 24e92716ad
commit 75de1f694c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 3300 additions and 2836 deletions

View File

@ -7,4 +7,4 @@ on:
jobs:
build:
uses: valitydev/base-workflow/.github/workflows/maven-library-build.yml@v1
uses: valitydev/java-workflow/.github/workflows/maven-library-build.yml@v3

View File

@ -8,9 +8,10 @@ on:
jobs:
deploy:
uses: valitydev/base-workflow/.github/workflows/maven-library-deploy.yml@v1
uses: valitydev/java-workflow/.github/workflows/maven-library-deploy.yml@v3
secrets:
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>dev.vality.geck</groupId>
<artifactId>parent</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -21,7 +21,6 @@
<dependency>
<groupId>dev.vality.woody</groupId>
<artifactId>libthrift</artifactId>
<version>${woody.version}</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>dev.vality.geck</groupId>
<artifactId>parent</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -29,7 +29,6 @@
<dependency>
<groupId>dev.vality.woody</groupId>
<artifactId>libthrift</artifactId>
<version>${woody.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@ -41,6 +40,10 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
</dependencies>
<profiles>
@ -53,6 +56,7 @@
<artifactId>thrift-maven-plugin</artifactId>
<configuration>
<thriftExecutable>thrift</thriftExecutable>
<generator>java:fullcamel,jakarta_annotations</generator>
</configuration>
<executions>
<execution>

View File

@ -1,38 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.io.Serializable, Cloneable, Comparable<Fail> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Fail");
private static final org.apache.thrift.protocol.TField CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("code", org.apache.thrift.protocol.TType.BYTE, (short)1);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new FailStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new FailTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FailStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FailTupleSchemeFactory();
public byte code; // required
public String description; // optional
public @org.apache.thrift.annotation.Nullable java.lang.String description; // 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 {
CODE((short)1, "code"),
DESCRIPTION((short)2, "description");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -40,6 +37,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
/**
* 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: // CODE
@ -57,30 +55,33 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -89,14 +90,14 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
private static final int __CODE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.DESCRIPTION};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.CODE, new org.apache.thrift.meta_data.FieldMetaData("code", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Fail.class, metaDataMap);
}
@ -122,6 +123,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
}
}
@Override
public Fail deepCopy() {
return new Fail(this);
}
@ -144,23 +146,24 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
}
public void unsetCode() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CODE_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CODE_ISSET_ID);
}
/** Returns true if field code is set (has been assigned a value) and false otherwise */
public boolean isSetCode() {
return EncodingUtils.testBit(__isset_bitfield, __CODE_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CODE_ISSET_ID);
}
public void setCodeIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CODE_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CODE_ISSET_ID, value);
}
public String getDescription() {
@org.apache.thrift.annotation.Nullable
public java.lang.String getDescription() {
return this.description;
}
}
public Fail setDescription(String description) {
public Fail setDescription(@org.apache.thrift.annotation.Nullable java.lang.String description) {
this.description = description;
return this;
}
@ -180,13 +183,14 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case CODE:
if (value == null) {
unsetCode();
} else {
setCode((Byte)value);
setCode((java.lang.Byte) value);
}
break;
@ -194,14 +198,16 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
if (value == null) {
unsetDescription();
} else {
setDescription((String)value);
setDescription((java.lang.String) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case CODE:
return getCode();
@ -210,13 +216,14 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return getDescription();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -225,13 +232,11 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
case DESCRIPTION:
return isSetDescription();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Fail)
return this.equals((Fail)that);
return false;
@ -240,6 +245,8 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
public boolean equals(Fail that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_code = true;
boolean that_present_code = true;
@ -283,7 +290,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetCode()).compareTo(other.isSetCode());
lastComparison = java.lang.Boolean.compare(isSetCode(), other.isSetCode());
if (lastComparison != 0) {
return lastComparison;
}
@ -293,7 +300,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
lastComparison = java.lang.Boolean.compare(isSetDescription(), other.isSetDescription());
if (lastComparison != 0) {
return lastComparison;
}
@ -306,6 +313,8 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -314,21 +323,23 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Fail(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Fail(");
boolean first = true;
sb.append("code:");
@ -362,7 +373,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -370,16 +381,18 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
private static class FailStandardSchemeFactory implements SchemeFactory {
private static class FailStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FailStandardScheme getScheme() {
return new FailStandardScheme();
}
}
}
private static class FailStandardScheme extends StandardScheme<Fail> {
private static class FailStandardScheme extends org.apache.thrift.scheme.StandardScheme<Fail> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Fail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -415,11 +428,12 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetCode()) {
throw new TProtocolException("Required field 'code' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'code' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Fail struct) throws org.apache.thrift.TException {
struct.validate();
@ -438,21 +452,22 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
oprot.writeStructEnd();
}
}
}
private static class FailTupleSchemeFactory implements SchemeFactory {
private static class FailTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FailTupleScheme getScheme() {
return new FailTupleScheme();
}
}
}
private static class FailTupleScheme extends TupleScheme<Fail> {
private static class FailTupleScheme extends org.apache.thrift.scheme.TupleScheme<Fail> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Fail struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeByte(struct.code);
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetDescription()) {
optionals.set(0);
}
@ -464,19 +479,19 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Fail struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.code = iprot.readByte();
struct.setCodeIsSet(true);
BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,26 +1,23 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.Serializable, Cloneable, Comparable<Ids> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Ids");
private static final org.apache.thrift.protocol.TField MICRO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("micro_id", org.apache.thrift.protocol.TType.BYTE, (short)1);
private static final org.apache.thrift.protocol.TField MINI_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mini_id", org.apache.thrift.protocol.TType.I16, (short)2);
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short) 3);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new IdsStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new IdsTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IdsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IdsTupleSchemeFactory();
public byte micro_id; // required
public short mini_id; // required
@ -32,10 +29,10 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
MINI_ID((short)2, "mini_id"),
ID((short)3, "id");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -43,6 +40,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
/**
* 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: // MICRO_ID
@ -62,30 +60,33 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -95,16 +96,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
private static final int __MINI_ID_ISSET_ID = 1;
private static final int __ID_ISSET_ID = 2;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.MICRO_ID, new org.apache.thrift.meta_data.FieldMetaData("micro_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.MINI_ID, new org.apache.thrift.meta_data.FieldMetaData("mini_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Ids.class, metaDataMap);
}
@ -135,6 +136,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
this.id = other.id;
}
@Override
public Ids deepCopy() {
return new Ids(this);
}
@ -160,16 +162,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetMicroId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
}
/** Returns true if field micro_id is set (has been assigned a value) and false otherwise */
public boolean isSetMicroId() {
return EncodingUtils.testBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
}
public void setMicroIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MICRO_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MICRO_ID_ISSET_ID, value);
}
public short getMiniId() {
@ -183,16 +185,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetMiniId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MINI_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MINI_ID_ISSET_ID);
}
/** Returns true if field mini_id is set (has been assigned a value) and false otherwise */
public boolean isSetMiniId() {
return EncodingUtils.testBit(__isset_bitfield, __MINI_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MINI_ID_ISSET_ID);
}
public void setMiniIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MINI_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MINI_ID_ISSET_ID, value);
}
public int getId() {
@ -206,25 +208,26 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
}
public void setIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case MICRO_ID:
if (value == null) {
unsetMicroId();
} else {
setMicroId((Byte)value);
setMicroId((java.lang.Byte) value);
}
break;
@ -232,7 +235,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
if (value == null) {
unsetMiniId();
} else {
setMiniId((Short)value);
setMiniId((java.lang.Short) value);
}
break;
@ -240,14 +243,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
if (value == null) {
unsetId();
} else {
setId((Integer)value);
setId((java.lang.Integer) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case MICRO_ID:
return getMicroId();
@ -259,13 +264,14 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return getId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -276,13 +282,11 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
case ID:
return isSetId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Ids)
return this.equals((Ids)that);
return false;
@ -291,6 +295,8 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
public boolean equals(Ids that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_micro_id = true;
boolean that_present_micro_id = true;
@ -343,7 +349,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetMicroId()).compareTo(other.isSetMicroId());
lastComparison = java.lang.Boolean.compare(isSetMicroId(), other.isSetMicroId());
if (lastComparison != 0) {
return lastComparison;
}
@ -353,7 +359,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetMiniId()).compareTo(other.isSetMiniId());
lastComparison = java.lang.Boolean.compare(isSetMiniId(), other.isSetMiniId());
if (lastComparison != 0) {
return lastComparison;
}
@ -363,7 +369,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
@ -376,6 +382,8 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -384,21 +392,23 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Ids(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Ids(");
boolean first = true;
sb.append("micro_id:");
@ -432,7 +442,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -440,16 +450,18 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
private static class IdsStandardSchemeFactory implements SchemeFactory {
private static class IdsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IdsStandardScheme getScheme() {
return new IdsStandardScheme();
}
}
}
private static class IdsStandardScheme extends StandardScheme<Ids> {
private static class IdsStandardScheme extends org.apache.thrift.scheme.StandardScheme<Ids> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Ids struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -493,17 +505,18 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetMicroId()) {
throw new TProtocolException("Required field 'micro_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'micro_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetMiniId()) {
throw new TProtocolException("Required field 'mini_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'mini_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetId()) {
throw new TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Ids struct) throws org.apache.thrift.TException {
struct.validate();
@ -521,19 +534,20 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
oprot.writeStructEnd();
}
}
}
private static class IdsTupleSchemeFactory implements SchemeFactory {
private static class IdsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IdsTupleScheme getScheme() {
return new IdsTupleScheme();
}
}
}
private static class IdsTupleScheme extends TupleScheme<Ids> {
private static class IdsTupleScheme extends org.apache.thrift.scheme.TupleScheme<Ids> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Ids struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeByte(struct.micro_id);
oprot.writeI16(struct.mini_id);
oprot.writeI32(struct.id);
@ -541,7 +555,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Ids struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.micro_id = iprot.readByte();
struct.setMicroIdIsSet(true);
struct.mini_id = iprot.readI16();
@ -549,10 +563,10 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
struct.id = iprot.readI32();
struct.setIdIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,31 +1,30 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Serializable, Cloneable, Comparable<Ok> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Ok");
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new OkStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new OkTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OkStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OkTupleSchemeFactory();
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -33,6 +32,7 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
/**
* 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) {
default:
@ -46,37 +46,41 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Ok.class, metaDataMap);
}
@ -89,6 +93,7 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
public Ok(Ok other) {
}
@Override
public Ok deepCopy() {
return new Ok(this);
}
@ -97,32 +102,34 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Ok)
return this.equals((Ok)that);
return false;
@ -131,6 +138,8 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
public boolean equals(Ok that) {
if (that == null)
return false;
if (this == that)
return true;
return true;
}
@ -153,6 +162,8 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -161,21 +172,23 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Ok(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Ok(");
boolean first = true;
sb.append(")");
@ -195,22 +208,24 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 OkStandardSchemeFactory implements SchemeFactory {
private static class OkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public OkStandardScheme getScheme() {
return new OkStandardScheme();
}
}
}
private static class OkStandardScheme extends StandardScheme<Ok> {
private static class OkStandardScheme extends org.apache.thrift.scheme.StandardScheme<Ok> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Ok struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -230,8 +245,9 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Ok struct) throws org.apache.thrift.TException {
struct.validate();
@ -240,29 +256,30 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
oprot.writeStructEnd();
}
}
}
private static class OkTupleSchemeFactory implements SchemeFactory {
private static class OkTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public OkTupleScheme getScheme() {
return new OkTupleScheme();
}
}
}
private static class OkTupleScheme extends TupleScheme<Ok> {
private static class OkTupleScheme extends org.apache.thrift.scheme.TupleScheme<Ok> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Ok struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Ok struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,9 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.protocol.TProtocolException;
import java.util.*;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Status");
private static final org.apache.thrift.protocol.TField OK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("ok_status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@ -16,10 +21,10 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
FAIL_STATUS((short)2, "fail_status"),
UNKNOWN_STATUS((short)3, "unknown_status");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -27,6 +32,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
/**
* 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: // OK_STATUS
@ -46,44 +52,47 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.OK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("ok_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Ok.class)));
tmpMap.put(_Fields.FAIL_STATUS, new org.apache.thrift.meta_data.FieldMetaData("fail_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Fail.class)));
tmpMap.put(_Fields.UNKNOWN_STATUS, new org.apache.thrift.meta_data.FieldMetaData("unknown_status", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Unknown.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Status.class, metaDataMap);
}
@ -91,13 +100,15 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
super();
}
public Status(_Fields setField, Object value) {
public Status(_Fields setField, java.lang.Object value) {
super(setField, value);
}
public Status(Status other) {
super(other);
}
@Override
public Status deepCopy() {
return new Status(this);
}
@ -122,30 +133,30 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
@Override
protected void checkType(_Fields setField, Object value) throws ClassCastException {
protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
switch (setField) {
case OK_STATUS:
if (value instanceof Ok) {
break;
}
throw new ClassCastException("Was expecting value of type Ok for field 'ok_status', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type Ok for field 'ok_status', but got " + value.getClass().getSimpleName());
case FAIL_STATUS:
if (value instanceof Fail) {
break;
}
throw new ClassCastException("Was expecting value of type Fail for field 'fail_status', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type Fail for field 'fail_status', but got " + value.getClass().getSimpleName());
case UNKNOWN_STATUS:
if (value instanceof Unknown) {
break;
}
throw new ClassCastException("Was expecting value of type Unknown for field 'unknown_status', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type Unknown for field 'unknown_status', but got " + value.getClass().getSimpleName());
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(field.id);
if (setField != null) {
switch (setField) {
@ -180,7 +191,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
return null;
}
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
@ -204,12 +215,12 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
unknown_status.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(fieldID);
if (setField != null) {
switch (setField) {
@ -229,10 +240,10 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
unknown_status.read(iprot);
return unknown_status;
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new TProtocolException("Couldn't find a field with field id " + fieldID);
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@ -252,7 +263,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
unknown_status.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@ -266,7 +277,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
case UNKNOWN_STATUS:
return UNKNOWN_STATUS_FIELD_DESC;
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@ -284,10 +295,12 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -297,42 +310,39 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
if (getSetField() == _Fields.OK_STATUS) {
return (Ok)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'ok_status' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'ok_status' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setOkStatus(Ok value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.OK_STATUS;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.OK_STATUS");
}
public Fail getFailStatus() {
if (getSetField() == _Fields.FAIL_STATUS) {
return (Fail)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'fail_status' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'fail_status' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setFailStatus(Fail value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.FAIL_STATUS;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.FAIL_STATUS");
}
public Unknown getUnknownStatus() {
if (getSetField() == _Fields.UNKNOWN_STATUS) {
return (Unknown)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'unknown_status' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'unknown_status' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setUnknownStatus(Unknown value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.UNKNOWN_STATUS;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.UNKNOWN_STATUS");
}
public boolean isSetOkStatus() {
@ -350,7 +360,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
}
public boolean equals(Object other) {
public boolean equals(java.lang.Object other) {
if (other instanceof Status) {
return equals((Status)other);
} else {
@ -374,12 +384,12 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {
list.add(setField.getThriftFieldId());
Object value = getFieldValue();
java.lang.Object value = getFieldValue();
if (value instanceof org.apache.thrift.TEnum) {
list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
} else {
@ -397,7 +407,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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) {

View File

@ -1,17 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class TestObject implements org.apache.thrift.TBase<TestObject, TestObject._Fields>, java.io.Serializable, Cloneable, Comparable<TestObject> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TestObject");
@ -19,38 +16,42 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
private static final org.apache.thrift.protocol.TField OTHER_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("other_ids", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField WORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("words", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField NUMBERS_FIELD_DESC = new org.apache.thrift.protocol.TField("numbers", org.apache.thrift.protocol.TType.LIST, (short)6);
private static final org.apache.thrift.protocol.TField LIST_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("list_ids", org.apache.thrift.protocol.TType.LIST, (short)7);
private static final org.apache.thrift.protocol.TField STATUSES_FIELD_DESC = new org.apache.thrift.protocol.TField("statuses", org.apache.thrift.protocol.TType.LIST, (short)8);
private static final org.apache.thrift.protocol.TField STATUSES_FIELD_DESC = new org.apache.thrift.protocol.TField("statuses", org.apache.thrift.protocol.TType.LIST, (short) 8);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new TestObjectStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new TestObjectTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TestObjectStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TestObjectTupleSchemeFactory();
public long id; // required
public Ids other_ids; // required
public Status status; // required
public Type type; // required
public String words; // optional
public List<Long> numbers; // optional
public List<Ids> list_ids; // optional
public List<List<Status>> statuses; // optional
public @org.apache.thrift.annotation.Nullable Ids other_ids; // required
public @org.apache.thrift.annotation.Nullable Status status; // required
/**
* @see Type
*/
public @org.apache.thrift.annotation.Nullable Type type; // required
public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> numbers; // optional
public @org.apache.thrift.annotation.Nullable java.util.List<Ids> list_ids; // optional
public @org.apache.thrift.annotation.Nullable java.util.List<java.util.List<Status>> statuses; // 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 {
ID((short)1, "id"),
OTHER_IDS((short)2, "other_ids"),
STATUS((short)3, "status"),
/**
*
* @see Type
*/
TYPE((short)4, "type"),
WORDS((short)5, "words"),
NUMBERS((short)6, "numbers"),
LIST_IDS((short)7, "list_ids"),
STATUSES((short)8, "statuses");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -58,6 +59,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
/**
* 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: // ID
@ -68,8 +70,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return STATUS;
case 4: // TYPE
return TYPE;
case 5: // WORDS
return WORDS;
case 6: // NUMBERS
return NUMBERS;
case 7: // LIST_IDS
@ -87,30 +87,33 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -118,10 +121,10 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
// isset id assignments
private static final int __ID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.WORDS, _Fields.NUMBERS, _Fields.LIST_IDS, _Fields.STATUSES};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
private static final _Fields optionals[] = {_Fields.NUMBERS, _Fields.LIST_IDS, _Fields.STATUSES};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.OTHER_IDS, new org.apache.thrift.meta_data.FieldMetaData("other_ids", org.apache.thrift.TFieldRequirementType.REQUIRED,
@ -130,8 +133,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Status.class)));
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Type.class)));
tmpMap.put(_Fields.WORDS, new org.apache.thrift.meta_data.FieldMetaData("words", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.NUMBERS, new org.apache.thrift.meta_data.FieldMetaData("numbers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
@ -142,7 +143,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Status.class)))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TestObject.class, metaDataMap);
}
@ -178,26 +179,23 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (other.isSetType()) {
this.type = other.type;
}
if (other.isSetWords()) {
this.words = other.words;
}
if (other.isSetNumbers()) {
List<Long> __this__numbers = new ArrayList<Long>(other.numbers);
java.util.List<java.lang.Long> __this__numbers = new java.util.ArrayList<java.lang.Long>(other.numbers);
this.numbers = __this__numbers;
}
if (other.isSetListIds()) {
List<Ids> __this__list_ids = new ArrayList<Ids>(other.list_ids.size());
java.util.List<Ids> __this__list_ids = new java.util.ArrayList<Ids>(other.list_ids.size());
for (Ids other_element : other.list_ids) {
__this__list_ids.add(other_element);
__this__list_ids.add(new Ids(other_element));
}
this.list_ids = __this__list_ids;
}
if (other.isSetStatuses()) {
List<List<Status>> __this__statuses = new ArrayList<List<Status>>(other.statuses.size());
for (List<Status> other_element : other.statuses) {
List<Status> __this__statuses_copy = new ArrayList<Status>(other_element.size());
java.util.List<java.util.List<Status>> __this__statuses = new java.util.ArrayList<java.util.List<Status>>(other.statuses.size());
for (java.util.List<Status> other_element : other.statuses) {
java.util.List<Status> __this__statuses_copy = new java.util.ArrayList<Status>(other_element.size());
for (Status other_element_element : other_element) {
__this__statuses_copy.add(other_element_element);
__this__statuses_copy.add(new Status(other_element_element));
}
__this__statuses.add(__this__statuses_copy);
}
@ -205,6 +203,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
@Override
public TestObject deepCopy() {
return new TestObject(this);
}
@ -216,7 +215,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
this.other_ids = null;
this.status = null;
this.type = null;
this.words = null;
this.numbers = null;
this.list_ids = null;
this.statuses = null;
@ -233,23 +231,24 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
public void unsetId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
}
public void setIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public Ids getOtherIds() {
return this.other_ids;
}
}
public TestObject setOtherIds(Ids other_ids) {
public TestObject setOtherIds(@org.apache.thrift.annotation.Nullable Ids other_ids) {
this.other_ids = other_ids;
return this;
}
@ -269,11 +268,12 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
@org.apache.thrift.annotation.Nullable
public Status getStatus() {
return this.status;
}
}
public TestObject setStatus(Status status) {
public TestObject setStatus(@org.apache.thrift.annotation.Nullable Status status) {
this.status = status;
return this;
}
@ -293,11 +293,18 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
/**
* @see Type
*/
@org.apache.thrift.annotation.Nullable
public Type getType() {
return this.type;
}
public TestObject setType(Type type) {
/**
* @see Type
*/
public TestObject setType(@org.apache.thrift.annotation.Nullable Type type) {
this.type = type;
return this;
}
@ -317,50 +324,28 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
public String getWords() {
return this.words;
}
public TestObject setWords(String words) {
this.words = words;
return this;
}
public void unsetWords() {
this.words = null;
}
/** Returns true if field words is set (has been assigned a value) and false otherwise */
public boolean isSetWords() {
return this.words != null;
}
public void setWordsIsSet(boolean value) {
if (!value) {
this.words = null;
}
}
public int getNumbersSize() {
return (this.numbers == null) ? 0 : this.numbers.size();
}
public java.util.Iterator<Long> getNumbersIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.lang.Long> getNumbersIterator() {
return (this.numbers == null) ? null : this.numbers.iterator();
}
public void addToNumbers(long elem) {
if (this.numbers == null) {
this.numbers = new ArrayList<Long>();
this.numbers = new java.util.ArrayList<java.lang.Long>();
}
this.numbers.add(elem);
}
public List<Long> getNumbers() {
@org.apache.thrift.annotation.Nullable
public java.util.List<java.lang.Long> getNumbers() {
return this.numbers;
}
public TestObject setNumbers(List<Long> numbers) {
public TestObject setNumbers(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.Long> numbers) {
this.numbers = numbers;
return this;
}
@ -384,22 +369,24 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return (this.list_ids == null) ? 0 : this.list_ids.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<Ids> getListIdsIterator() {
return (this.list_ids == null) ? null : this.list_ids.iterator();
}
public void addToListIds(Ids elem) {
if (this.list_ids == null) {
this.list_ids = new ArrayList<Ids>();
this.list_ids = new java.util.ArrayList<Ids>();
}
this.list_ids.add(elem);
}
public List<Ids> getListIds() {
@org.apache.thrift.annotation.Nullable
public java.util.List<Ids> getListIds() {
return this.list_ids;
}
public TestObject setListIds(List<Ids> list_ids) {
public TestObject setListIds(@org.apache.thrift.annotation.Nullable java.util.List<Ids> list_ids) {
this.list_ids = list_ids;
return this;
}
@ -423,22 +410,24 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return (this.statuses == null) ? 0 : this.statuses.size();
}
public java.util.Iterator<List<Status>> getStatusesIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.util.List<Status>> getStatusesIterator() {
return (this.statuses == null) ? null : this.statuses.iterator();
}
public void addToStatuses(List<Status> elem) {
public void addToStatuses(java.util.List<Status> elem) {
if (this.statuses == null) {
this.statuses = new ArrayList<List<Status>>();
this.statuses = new java.util.ArrayList<java.util.List<Status>>();
}
this.statuses.add(elem);
}
public List<List<Status>> getStatuses() {
@org.apache.thrift.annotation.Nullable
public java.util.List<java.util.List<Status>> getStatuses() {
return this.statuses;
}
public TestObject setStatuses(List<List<Status>> statuses) {
public TestObject setStatuses(@org.apache.thrift.annotation.Nullable java.util.List<java.util.List<Status>> statuses) {
this.statuses = statuses;
return this;
}
@ -458,13 +447,14 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((Long)value);
setId((java.lang.Long) value);
}
break;
@ -492,19 +482,11 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
break;
case WORDS:
if (value == null) {
unsetWords();
} else {
setWords((String)value);
}
break;
case NUMBERS:
if (value == null) {
unsetNumbers();
} else {
setNumbers((List<Long>)value);
setNumbers((java.util.List<java.lang.Long>) value);
}
break;
@ -512,7 +494,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (value == null) {
unsetListIds();
} else {
setListIds((List<Ids>)value);
setListIds((java.util.List<Ids>) value);
}
break;
@ -520,14 +502,16 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (value == null) {
unsetStatuses();
} else {
setStatuses((List<List<Status>>)value);
setStatuses((java.util.List<java.util.List<Status>>) value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
@ -541,9 +525,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
case TYPE:
return getType();
case WORDS:
return getWords();
case NUMBERS:
return getNumbers();
@ -554,13 +535,14 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return getStatuses();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -572,8 +554,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return isSetStatus();
case TYPE:
return isSetType();
case WORDS:
return isSetWords();
case NUMBERS:
return isSetNumbers();
case LIST_IDS:
@ -581,13 +561,11 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
case STATUSES:
return isSetStatuses();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof TestObject)
return this.equals((TestObject)that);
return false;
@ -596,6 +574,8 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
public boolean equals(TestObject that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_id = true;
boolean that_present_id = true;
@ -633,15 +613,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return false;
}
boolean this_present_words = true && this.isSetWords();
boolean that_present_words = true && that.isSetWords();
if (this_present_words || that_present_words) {
if (!(this_present_words && that_present_words))
return false;
if (!this.words.equals(that.words))
return false;
}
boolean this_present_numbers = true && this.isSetNumbers();
boolean that_present_numbers = true && that.isSetNumbers();
if (this_present_numbers || that_present_numbers) {
@ -690,10 +661,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (isSetType())
hashCode = hashCode * 8191 + type.getValue();
hashCode = hashCode * 8191 + ((isSetWords()) ? 131071 : 524287);
if (isSetWords())
hashCode = hashCode * 8191 + words.hashCode();
hashCode = hashCode * 8191 + ((isSetNumbers()) ? 131071 : 524287);
if (isSetNumbers())
hashCode = hashCode * 8191 + numbers.hashCode();
@ -717,7 +684,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
@ -727,7 +694,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOtherIds()).compareTo(other.isSetOtherIds());
lastComparison = java.lang.Boolean.compare(isSetOtherIds(), other.isSetOtherIds());
if (lastComparison != 0) {
return lastComparison;
}
@ -737,7 +704,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
@ -747,7 +714,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType());
if (lastComparison != 0) {
return lastComparison;
}
@ -757,17 +724,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetWords()).compareTo(other.isSetWords());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetWords()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.words, other.words);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetNumbers()).compareTo(other.isSetNumbers());
lastComparison = java.lang.Boolean.compare(isSetNumbers(), other.isSetNumbers());
if (lastComparison != 0) {
return lastComparison;
}
@ -777,7 +734,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetListIds()).compareTo(other.isSetListIds());
lastComparison = java.lang.Boolean.compare(isSetListIds(), other.isSetListIds());
if (lastComparison != 0) {
return lastComparison;
}
@ -787,7 +744,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatuses()).compareTo(other.isSetStatuses());
lastComparison = java.lang.Boolean.compare(isSetStatuses(), other.isSetStatuses());
if (lastComparison != 0) {
return lastComparison;
}
@ -800,6 +757,8 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -808,21 +767,23 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TestObject(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("TestObject(");
boolean first = true;
sb.append("id:");
@ -852,16 +813,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
sb.append(this.type);
}
first = false;
if (isSetWords()) {
if (!first) sb.append(", ");
sb.append("words:");
if (this.words == null) {
sb.append("null");
} else {
sb.append(this.words);
}
first = false;
}
if (isSetNumbers()) {
if (!first) sb.append(", ");
sb.append("numbers:");
@ -900,15 +851,18 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
// check for required fields
// alas, we cannot check 'id' because it's a primitive and you chose the non-beans generator.
if (other_ids == null) {
throw new TProtocolException("Required field 'other_ids' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'other_ids' was not present! Struct: " + toString());
}
if (status == null) {
throw new TProtocolException("Required field 'status' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
}
if (type == null) {
throw new TProtocolException("Required field 'type' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (other_ids != null) {
other_ids.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@ -919,7 +873,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -929,21 +883,23 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
private static class TestObjectStandardSchemeFactory implements SchemeFactory {
private static class TestObjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TestObjectStandardScheme getScheme() {
return new TestObjectStandardScheme();
}
}
private static class TestObjectStandardScheme extends StandardScheme<TestObject> {
private static class TestObjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<TestObject> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, TestObject 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) {
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
@ -951,7 +907,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.id = iprot.readI64();
struct.setIdIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -960,7 +916,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
struct.other_ids = new Ids();
struct.other_ids.read(iprot);
struct.setOtherIdsIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -969,23 +925,15 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
struct.status = new Status();
struct.status.read(iprot);
struct.setStatusIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.type = Type.findByValue(iprot.readI32());
struct.type = dev.vality.geck.filter.test.Type.findByValue(iprot.readI32());
struct.setTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // WORDS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.words = iprot.readString();
struct.setWordsIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -993,7 +941,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
struct.numbers = new ArrayList<Long>(_list0.size);
struct.numbers = new java.util.ArrayList<java.lang.Long>(_list0.size);
long _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
@ -1003,7 +951,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
iprot.readListEnd();
}
struct.setNumbersIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -1011,8 +959,8 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
struct.list_ids = new ArrayList<Ids>(_list3.size);
Ids _elem4;
struct.list_ids = new java.util.ArrayList<Ids>(_list3.size);
@org.apache.thrift.annotation.Nullable Ids _elem4;
for (int _i5 = 0; _i5 < _list3.size; ++_i5)
{
_elem4 = new Ids();
@ -1022,7 +970,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
iprot.readListEnd();
}
struct.setListIdsIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -1030,14 +978,14 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list6 = iprot.readListBegin();
struct.statuses = new ArrayList<List<Status>>(_list6.size);
List<Status> _elem7;
struct.statuses = new java.util.ArrayList<java.util.List<Status>>(_list6.size);
@org.apache.thrift.annotation.Nullable java.util.List<Status> _elem7;
for (int _i8 = 0; _i8 < _list6.size; ++_i8)
{
{
org.apache.thrift.protocol.TList _list9 = iprot.readListBegin();
_elem7 = new ArrayList<Status>(_list9.size);
Status _elem10;
_elem7 = new java.util.ArrayList<Status>(_list9.size);
@org.apache.thrift.annotation.Nullable Status _elem10;
for (int _i11 = 0; _i11 < _list9.size; ++_i11)
{
_elem10 = new Status();
@ -1051,7 +999,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
iprot.readListEnd();
}
struct.setStatusesIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -1064,11 +1012,12 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetId()) {
throw new TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, TestObject struct) throws org.apache.thrift.TException {
struct.validate();
@ -1091,13 +1040,6 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
oprot.writeI32(struct.type.getValue());
oprot.writeFieldEnd();
}
if (struct.words != null) {
if (struct.isSetWords()) {
oprot.writeFieldBegin(WORDS_FIELD_DESC);
oprot.writeString(struct.words);
oprot.writeFieldEnd();
}
}
if (struct.numbers != null) {
if (struct.isSetNumbers()) {
oprot.writeFieldBegin(NUMBERS_FIELD_DESC);
@ -1131,7 +1073,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
oprot.writeFieldBegin(STATUSES_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.statuses.size()));
for (List<Status> _iter14 : struct.statuses)
for (java.util.List<Status> _iter14 : struct.statuses)
{
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter14.size()));
@ -1153,38 +1095,33 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
private static class TestObjectTupleSchemeFactory implements SchemeFactory {
private static class TestObjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TestObjectTupleScheme getScheme() {
return new TestObjectTupleScheme();
}
}
private static class TestObjectTupleScheme extends TupleScheme<TestObject> {
private static class TestObjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<TestObject> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TestObject struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI64(struct.id);
struct.other_ids.write(oprot);
struct.status.write(oprot);
oprot.writeI32(struct.type.getValue());
BitSet optionals = new BitSet();
if (struct.isSetWords()) {
optionals.set(0);
}
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetNumbers()) {
optionals.set(1);
optionals.set(0);
}
if (struct.isSetListIds()) {
optionals.set(1);
}
if (struct.isSetStatuses()) {
optionals.set(2);
}
if (struct.isSetStatuses()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetWords()) {
oprot.writeString(struct.words);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetNumbers()) {
{
oprot.writeI32(struct.numbers.size());
@ -1206,7 +1143,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
if (struct.isSetStatuses()) {
{
oprot.writeI32(struct.statuses.size());
for (List<Status> _iter18 : struct.statuses)
for (java.util.List<Status> _iter18 : struct.statuses)
{
{
oprot.writeI32(_iter18.size());
@ -1222,7 +1159,7 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TestObject struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.id = iprot.readI64();
struct.setIdIsSet(true);
struct.other_ids = new Ids();
@ -1231,17 +1168,13 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
struct.status = new Status();
struct.status.read(iprot);
struct.setStatusIsSet(true);
struct.type = Type.findByValue(iprot.readI32());
struct.type = dev.vality.geck.filter.test.Type.findByValue(iprot.readI32());
struct.setTypeIsSet(true);
BitSet incoming = iprot.readBitSet(4);
java.util.BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.words = iprot.readString();
struct.setWordsIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32());
struct.numbers = new ArrayList<Long>(_list20.size);
org.apache.thrift.protocol.TList _list20 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64);
struct.numbers = new java.util.ArrayList<java.lang.Long>(_list20.size);
long _elem21;
for (int _i22 = 0; _i22 < _list20.size; ++_i22)
{
@ -1251,11 +1184,11 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
struct.setNumbersIsSet(true);
}
if (incoming.get(2)) {
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.list_ids = new ArrayList<Ids>(_list23.size);
Ids _elem24;
org.apache.thrift.protocol.TList _list23 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.list_ids = new java.util.ArrayList<Ids>(_list23.size);
@org.apache.thrift.annotation.Nullable Ids _elem24;
for (int _i25 = 0; _i25 < _list23.size; ++_i25)
{
_elem24 = new Ids();
@ -1265,17 +1198,17 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
struct.setListIdsIsSet(true);
}
if (incoming.get(3)) {
if (incoming.get(2)) {
{
org.apache.thrift.protocol.TList _list26 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32());
struct.statuses = new ArrayList<List<Status>>(_list26.size);
List<Status> _elem27;
org.apache.thrift.protocol.TList _list26 = iprot.readListBegin(org.apache.thrift.protocol.TType.LIST);
struct.statuses = new java.util.ArrayList<java.util.List<Status>>(_list26.size);
@org.apache.thrift.annotation.Nullable java.util.List<Status> _elem27;
for (int _i28 = 0; _i28 < _list26.size; ++_i28)
{
{
org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
_elem27 = new ArrayList<Status>(_list29.size);
Status _elem30;
org.apache.thrift.protocol.TList _list29 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
_elem27 = new java.util.ArrayList<Status>(_list29.size);
@org.apache.thrift.annotation.Nullable Status _elem30;
for (int _i31 = 0; _i31 < _list29.size; ++_i31)
{
_elem30 = new Status();
@ -1291,8 +1224,8 @@ public class TestObject implements org.apache.thrift.TBase<TestObject, TestObjec
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,8 +1,15 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.TEnum;
public enum Type implements TEnum {
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public enum Type implements org.apache.thrift.TEnum {
BLACK(1),
RED(2),
GREEN(3);
@ -16,6 +23,7 @@ public enum Type implements TEnum {
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
@Override
public int getValue() {
return value;
}
@ -24,6 +32,7 @@ public enum Type implements TEnum {
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static Type findByValue(int value) {
switch (value) {
case 1:

View File

@ -1,37 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields>, java.io.Serializable, Cloneable, Comparable<Unknown> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Unknown");
private static final org.apache.thrift.protocol.TField UNKNOWN_FIELD_DESC = new org.apache.thrift.protocol.TField("unknown", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new UnknownStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new UnknownTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UnknownStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UnknownTupleSchemeFactory();
public UnknownType unknown; // required
public String description; // optional
public @org.apache.thrift.annotation.Nullable UnknownType unknown; // required
public @org.apache.thrift.annotation.Nullable java.lang.String description; // 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 {
UNKNOWN((short)1, "unknown"),
DESCRIPTION((short)2, "description");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -39,6 +37,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
/**
* 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: // UNKNOWN
@ -56,44 +55,47 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.DESCRIPTION};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.UNKNOWN, new org.apache.thrift.meta_data.FieldMetaData("unknown", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UnknownType.class)));
tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Unknown.class, metaDataMap);
}
@ -119,6 +121,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
@Override
public Unknown deepCopy() {
return new Unknown(this);
}
@ -129,11 +132,12 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
this.description = null;
}
@org.apache.thrift.annotation.Nullable
public UnknownType getUnknown() {
return this.unknown;
}
}
public Unknown setUnknown(UnknownType unknown) {
public Unknown setUnknown(@org.apache.thrift.annotation.Nullable UnknownType unknown) {
this.unknown = unknown;
return this;
}
@ -153,11 +157,12 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
public String getDescription() {
@org.apache.thrift.annotation.Nullable
public java.lang.String getDescription() {
return this.description;
}
}
public Unknown setDescription(String description) {
public Unknown setDescription(@org.apache.thrift.annotation.Nullable java.lang.String description) {
this.description = description;
return this;
}
@ -177,7 +182,8 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case UNKNOWN:
if (value == null) {
@ -191,14 +197,16 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
if (value == null) {
unsetDescription();
} else {
setDescription((String)value);
setDescription((java.lang.String) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case UNKNOWN:
return getUnknown();
@ -207,13 +215,14 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
return getDescription();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -222,13 +231,11 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
case DESCRIPTION:
return isSetDescription();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Unknown)
return this.equals((Unknown)that);
return false;
@ -237,6 +244,8 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
public boolean equals(Unknown that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_unknown = true && this.isSetUnknown();
boolean that_present_unknown = true && that.isSetUnknown();
@ -282,7 +291,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetUnknown()).compareTo(other.isSetUnknown());
lastComparison = java.lang.Boolean.compare(isSetUnknown(), other.isSetUnknown());
if (lastComparison != 0) {
return lastComparison;
}
@ -292,7 +301,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
lastComparison = java.lang.Boolean.compare(isSetDescription(), other.isSetDescription());
if (lastComparison != 0) {
return lastComparison;
}
@ -305,6 +314,8 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -313,21 +324,23 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Unknown(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Unknown(");
boolean first = true;
sb.append("unknown:");
@ -354,7 +367,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (unknown == null) {
throw new TProtocolException("Required field 'unknown' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'unknown' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -367,22 +380,24 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 UnknownStandardSchemeFactory implements SchemeFactory {
private static class UnknownStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public UnknownStandardScheme getScheme() {
return new UnknownStandardScheme();
}
}
}
private static class UnknownStandardScheme extends StandardScheme<Unknown> {
private static class UnknownStandardScheme extends org.apache.thrift.scheme.StandardScheme<Unknown> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Unknown struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -419,8 +434,9 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Unknown struct) throws org.apache.thrift.TException {
struct.validate();
@ -441,21 +457,22 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
oprot.writeStructEnd();
}
}
}
private static class UnknownTupleSchemeFactory implements SchemeFactory {
private static class UnknownTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public UnknownTupleScheme getScheme() {
return new UnknownTupleScheme();
}
}
}
private static class UnknownTupleScheme extends TupleScheme<Unknown> {
private static class UnknownTupleScheme extends org.apache.thrift.scheme.TupleScheme<Unknown> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Unknown struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.unknown.write(oprot);
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetDescription()) {
optionals.set(0);
}
@ -467,20 +484,20 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Unknown struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.unknown = new UnknownType();
struct.unknown.read(iprot);
struct.setUnknownIsSet(true);
BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,25 +1,28 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test;
import org.apache.thrift.protocol.TProtocolException;
import java.util.*;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownType._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnknownType");
private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField RESULT_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("resultTypes", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
RESULT((short)1, "result"),
RESULT_TYPES((short)2, "resultTypes"),
VALUE((short)3, "value");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -27,10 +30,9 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
/**
* 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: // RESULT
return RESULT;
case 2: // RESULT_TYPES
return RESULT_TYPES;
case 3: // VALUE
@ -46,45 +48,46 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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.RESULT_TYPES, new org.apache.thrift.meta_data.FieldMetaData("resultTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Type.class))));
tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UnknownType.class, metaDataMap);
}
@ -92,24 +95,20 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
super();
}
public UnknownType(_Fields setField, Object value) {
public UnknownType(_Fields setField, java.lang.Object value) {
super(setField, value);
}
public UnknownType(UnknownType other) {
super(other);
}
@Override
public UnknownType deepCopy() {
return new UnknownType(this);
}
}
public static UnknownType result(String value) {
UnknownType x = new UnknownType();
x.setResult(value);
return x;
}
public static UnknownType resultTypes(List<Type> value) {
public static UnknownType resultTypes(java.util.List<Type> value) {
UnknownType x = new UnknownType();
x.setResultTypes(value);
return x;
@ -123,53 +122,40 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
@Override
protected void checkType(_Fields setField, Object value) throws ClassCastException {
protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
switch (setField) {
case RESULT:
if (value instanceof String) {
break;
}
throw new ClassCastException("Was expecting value of type String for field 'result', but got " + value.getClass().getSimpleName());
case RESULT_TYPES:
if (value instanceof List) {
if (value instanceof java.util.List) {
break;
}
throw new ClassCastException("Was expecting value of type List<Type> for field 'resultTypes', but got " + value.getClass().getSimpleName());
}
throw new java.lang.ClassCastException("Was expecting value of type java.util.List<Type> for field 'resultTypes', but got " + value.getClass().getSimpleName());
case VALUE:
if (value instanceof Double) {
if (value instanceof java.lang.Double) {
break;
}
throw new ClassCastException("Was expecting value of type Double for field 'value', but got " + value.getClass().getSimpleName());
}
throw new java.lang.ClassCastException("Was expecting value of type java.lang.Double for field 'value', but got " + value.getClass().getSimpleName());
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(field.id);
if (setField != null) {
switch (setField) {
case RESULT:
if (field.type == RESULT_FIELD_DESC.type) {
String result;
result = iprot.readString();
return result;
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
return null;
}
case RESULT_TYPES:
if (field.type == RESULT_TYPES_FIELD_DESC.type) {
List<Type> resultTypes;
java.util.List<Type> resultTypes;
{
org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
resultTypes = new ArrayList<Type>(_list32.size);
Type _elem33;
for (int _i34 = 0; _i34 < _list32.size; ++_i34)
{
_elem33 = Type.findByValue(iprot.readI32());
resultTypes.add(_elem33);
resultTypes = new java.util.ArrayList<Type>(_list32.size);
@org.apache.thrift.annotation.Nullable Type _elem33;
for (int _i34 = 0; _i34 < _list32.size; ++_i34) {
_elem33 = dev.vality.geck.filter.test.Type.findByValue(iprot.readI32());
if (_elem33 != null) {
resultTypes.add(_elem33);
}
}
iprot.readListEnd();
}
@ -180,7 +166,7 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
}
case VALUE:
if (field.type == VALUE_FIELD_DESC.type) {
Double value;
java.lang.Double value;
value = iprot.readDouble();
return value;
} else {
@ -188,7 +174,7 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
return null;
}
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
@ -199,12 +185,8 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
@Override
protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case RESULT:
String result = (String)value_;
oprot.writeString(result);
return;
case RESULT_TYPES:
List<Type> resultTypes = (List<Type>)value_;
java.util.List<Type> resultTypes = (java.util.List<Type>) value_;
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, resultTypes.size()));
for (Type _iter35 : resultTypes)
@ -215,58 +197,51 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
}
return;
case VALUE:
Double value = (Double)value_;
java.lang.Double value = (java.lang.Double) value_;
oprot.writeDouble(value);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(fieldID);
if (setField != null) {
switch (setField) {
case RESULT:
String result;
result = iprot.readString();
return result;
case RESULT_TYPES:
List<Type> resultTypes;
java.util.List<Type> resultTypes;
{
org.apache.thrift.protocol.TList _list36 = iprot.readListBegin();
resultTypes = new ArrayList<Type>(_list36.size);
Type _elem37;
for (int _i38 = 0; _i38 < _list36.size; ++_i38)
{
_elem37 = Type.findByValue(iprot.readI32());
resultTypes.add(_elem37);
resultTypes = new java.util.ArrayList<Type>(_list36.size);
@org.apache.thrift.annotation.Nullable Type _elem37;
for (int _i38 = 0; _i38 < _list36.size; ++_i38) {
_elem37 = dev.vality.geck.filter.test.Type.findByValue(iprot.readI32());
if (_elem37 != null) {
resultTypes.add(_elem37);
}
}
iprot.readListEnd();
}
return resultTypes;
case VALUE:
Double value;
java.lang.Double value;
value = iprot.readDouble();
return value;
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new TProtocolException("Couldn't find a field with field id " + fieldID);
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@Override
protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case RESULT:
String result = (String)value_;
oprot.writeString(result);
return;
case RESULT_TYPES:
List<Type> resultTypes = (List<Type>)value_;
java.util.List<Type> resultTypes = (java.util.List<Type>) value_;
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, resultTypes.size()));
for (Type _iter39 : resultTypes)
@ -277,25 +252,23 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
}
return;
case VALUE:
Double value = (Double)value_;
java.lang.Double value = (java.lang.Double) value_;
oprot.writeDouble(value);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {
switch (setField) {
case RESULT:
return RESULT_FIELD_DESC;
case RESULT_TYPES:
return RESULT_TYPES_FIELD_DESC;
case VALUE:
return VALUE_FIELD_DESC;
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@ -313,48 +286,35 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public String getResult() {
if (getSetField() == _Fields.RESULT) {
return (String)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'result' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setResult(String value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.RESULT;
value_ = value;
}
public List<Type> getResultTypes() {
public java.util.List<Type> getResultTypes() {
if (getSetField() == _Fields.RESULT_TYPES) {
return (List<Type>)getFieldValue();
return (java.util.List<Type>) getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'resultTypes' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'resultTypes' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
}
public void setResultTypes(List<Type> value) {
if (value == null) throw new NullPointerException();
public void setResultTypes(java.util.List<Type> value) {
setField_ = _Fields.RESULT_TYPES;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.RESULT_TYPES");
}
public double getValue() {
if (getSetField() == _Fields.VALUE) {
return (Double)getFieldValue();
return (java.lang.Double) getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'value' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'value' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
@ -363,11 +323,6 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
value_ = value;
}
public boolean isSetResult() {
return setField_ == _Fields.RESULT;
}
public boolean isSetResultTypes() {
return setField_ == _Fields.RESULT_TYPES;
}
@ -378,7 +333,7 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
}
public boolean equals(Object other) {
public boolean equals(java.lang.Object other) {
if (other instanceof UnknownType) {
return equals((UnknownType)other);
} else {
@ -402,12 +357,12 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {
list.add(setField.getThriftFieldId());
Object value = getFieldValue();
java.lang.Object value = getFieldValue();
if (value instanceof org.apache.thrift.TEnum) {
list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
} else {
@ -425,7 +380,7 @@ public class UnknownType extends org.apache.thrift.TUnion<UnknownType, UnknownTy
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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) {

View File

@ -1,37 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, java.io.Serializable, Cloneable, Comparable<IData> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IData");
private static final org.apache.thrift.protocol.TField DATA_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("data_val", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField DATA_OPT_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("data_opt_val", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField DATA_OPT_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("data_opt_val", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new IDataStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new IDataTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IDataStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IDataTupleSchemeFactory();
public String data_val; // required
public String data_opt_val; // optional
public @org.apache.thrift.annotation.Nullable String data_val; // required
public @org.apache.thrift.annotation.Nullable String data_opt_val; // 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 {
DATA_VAL((short)1, "data_val"),
DATA_OPT_VAL((short)2, "data_opt_val");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -39,6 +37,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
/**
* 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: // DATA_VAL
@ -63,6 +62,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -75,10 +75,12 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
@ -86,14 +88,14 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
// isset id assignments
private static final _Fields optionals[] = {_Fields.DATA_OPT_VAL};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.DATA_VAL, new org.apache.thrift.meta_data.FieldMetaData("data_val", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.DATA_OPT_VAL, new org.apache.thrift.meta_data.FieldMetaData("data_opt_val", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IData.class, metaDataMap);
}
@ -119,6 +121,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
}
}
@Override
public IData deepCopy() {
return new IData(this);
}
@ -129,11 +132,12 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
this.data_opt_val = null;
}
@org.apache.thrift.annotation.Nullable
public String getDataVal() {
return this.data_val;
}
}
public IData setDataVal(String data_val) {
public IData setDataVal(@org.apache.thrift.annotation.Nullable String data_val) {
this.data_val = data_val;
return this;
}
@ -153,11 +157,12 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
}
}
@org.apache.thrift.annotation.Nullable
public String getDataOptVal() {
return this.data_opt_val;
}
}
public IData setDataOptVal(String data_opt_val) {
public IData setDataOptVal(@org.apache.thrift.annotation.Nullable String data_opt_val) {
this.data_opt_val = data_opt_val;
return this;
}
@ -177,7 +182,8 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case DATA_VAL:
if (value == null) {
@ -196,8 +202,10 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case DATA_VAL:
@ -211,6 +219,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -227,8 +236,6 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof IData)
return this.equals((IData)that);
return false;
@ -237,6 +244,8 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
public boolean equals(IData that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_data_val = true && this.isSetDataVal();
boolean that_present_data_val = true && that.isSetDataVal();
@ -282,7 +291,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetDataVal()).compareTo(other.isSetDataVal());
lastComparison = Boolean.compare(isSetDataVal(), other.isSetDataVal());
if (lastComparison != 0) {
return lastComparison;
}
@ -292,7 +301,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDataOptVal()).compareTo(other.isSetDataOptVal());
lastComparison = Boolean.compare(isSetDataOptVal(), other.isSetDataOptVal());
if (lastComparison != 0) {
return lastComparison;
}
@ -305,6 +314,8 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -313,14 +324,16 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -354,7 +367,7 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (data_val == null) {
throw new TProtocolException("Required field 'data_val' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'data_val' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -375,14 +388,16 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
}
}
private static class IDataStandardSchemeFactory implements SchemeFactory {
private static class IDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IDataStandardScheme getScheme() {
return new IDataStandardScheme();
}
}
}
private static class IDataStandardScheme extends StandardScheme<IData> {
private static class IDataStandardScheme extends org.apache.thrift.scheme.StandardScheme<IData> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, IData struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -418,8 +433,9 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, IData struct) throws org.apache.thrift.TException {
struct.validate();
@ -440,21 +456,22 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
oprot.writeStructEnd();
}
}
}
private static class IDataTupleSchemeFactory implements SchemeFactory {
private static class IDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IDataTupleScheme getScheme() {
return new IDataTupleScheme();
}
}
}
private static class IDataTupleScheme extends TupleScheme<IData> {
private static class IDataTupleScheme extends org.apache.thrift.scheme.TupleScheme<IData> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, IData struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.data_val);
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetDataOptVal()) {
optionals.set(0);
}
@ -466,19 +483,19 @@ public class IData implements org.apache.thrift.TBase<IData, IData._Fields>, jav
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, IData struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.data_val = iprot.readString();
struct.setDataValIsSet(true);
BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.data_opt_val = iprot.readString();
struct.setDataOptValIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,9 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TProtocolException;
import java.util.*;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, IDataCollection._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IDataCollection");
private static final org.apache.thrift.protocol.TField DATA_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("data_list", org.apache.thrift.protocol.TType.LIST, (short)1);
@ -14,10 +19,10 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
DATA_LIST((short)1, "data_list"),
DATA_SET((short)2, "data_set");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -25,6 +30,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
/**
* 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: // DATA_LIST
@ -49,6 +55,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -61,25 +68,27 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.DATA_LIST, new org.apache.thrift.meta_data.FieldMetaData("data_list", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IData.class))));
tmpMap.put(_Fields.DATA_SET, new org.apache.thrift.meta_data.FieldMetaData("data_set", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IData.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IDataCollection.class, metaDataMap);
}
@ -94,17 +103,19 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
public IDataCollection(IDataCollection other) {
super(other);
}
@Override
public IDataCollection deepCopy() {
return new IDataCollection(this);
}
}
public static IDataCollection data_list(List<IData> value) {
public static IDataCollection data_list(java.util.List<IData> value) {
IDataCollection x = new IDataCollection();
x.setDataList(value);
return x;
}
}
public static IDataCollection data_set(Set<IData> value) {
public static IDataCollection data_set(java.util.Set<IData> value) {
IDataCollection x = new IDataCollection();
x.setDataSet(value);
return x;
@ -115,15 +126,15 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
protected void checkType(_Fields setField, Object value) throws ClassCastException {
switch (setField) {
case DATA_LIST:
if (value instanceof List) {
if (value instanceof java.util.List) {
break;
}
throw new ClassCastException("Was expecting value of type List<IData> for field 'data_list', but got " + value.getClass().getSimpleName());
}
throw new ClassCastException("Was expecting value of type java.util.List<IData> for field 'data_list', but got " + value.getClass().getSimpleName());
case DATA_SET:
if (value instanceof Set) {
if (value instanceof java.util.Set) {
break;
}
throw new ClassCastException("Was expecting value of type Set<IData> for field 'data_set', but got " + value.getClass().getSimpleName());
}
throw new ClassCastException("Was expecting value of type java.util.Set<IData> for field 'data_set', but got " + value.getClass().getSimpleName());
default:
throw new IllegalArgumentException("Unknown field id " + setField);
}
@ -136,11 +147,11 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
switch (setField) {
case DATA_LIST:
if (field.type == DATA_LIST_FIELD_DESC.type) {
List<IData> data_list;
java.util.List<IData> data_list;
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
data_list = new ArrayList<IData>(_list0.size);
IData _elem1;
data_list = new java.util.ArrayList<IData>(_list0.size);
@org.apache.thrift.annotation.Nullable IData _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = new IData();
@ -156,11 +167,11 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
}
case DATA_SET:
if (field.type == DATA_SET_FIELD_DESC.type) {
Set<IData> data_set;
java.util.Set<IData> data_set;
{
org.apache.thrift.protocol.TSet _set3 = iprot.readSetBegin();
data_set = new HashSet<IData>(2*_set3.size);
IData _elem4;
data_set = new java.util.HashSet<IData>(2 * _set3.size);
@org.apache.thrift.annotation.Nullable IData _elem4;
for (int _i5 = 0; _i5 < _set3.size; ++_i5)
{
_elem4 = new IData();
@ -187,7 +198,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case DATA_LIST:
List<IData> data_list = (List<IData>)value_;
java.util.List<IData> data_list = (java.util.List<IData>) value_;
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, data_list.size()));
for (IData _iter6 : data_list)
@ -198,7 +209,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
}
return;
case DATA_SET:
Set<IData> data_set = (Set<IData>)value_;
java.util.Set<IData> data_set = (java.util.Set<IData>) value_;
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, data_set.size()));
for (IData _iter7 : data_set)
@ -219,11 +230,11 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
if (setField != null) {
switch (setField) {
case DATA_LIST:
List<IData> data_list;
java.util.List<IData> data_list;
{
org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
data_list = new ArrayList<IData>(_list8.size);
IData _elem9;
data_list = new java.util.ArrayList<IData>(_list8.size);
@org.apache.thrift.annotation.Nullable IData _elem9;
for (int _i10 = 0; _i10 < _list8.size; ++_i10)
{
_elem9 = new IData();
@ -234,11 +245,11 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
}
return data_list;
case DATA_SET:
Set<IData> data_set;
java.util.Set<IData> data_set;
{
org.apache.thrift.protocol.TSet _set11 = iprot.readSetBegin();
data_set = new HashSet<IData>(2*_set11.size);
IData _elem12;
data_set = new java.util.HashSet<IData>(2 * _set11.size);
@org.apache.thrift.annotation.Nullable IData _elem12;
for (int _i13 = 0; _i13 < _set11.size; ++_i13)
{
_elem12 = new IData();
@ -252,7 +263,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new TProtocolException("Couldn't find a field with field id " + fieldID);
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@ -260,7 +271,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
switch (setField_) {
case DATA_LIST:
List<IData> data_list = (List<IData>)value_;
java.util.List<IData> data_list = (java.util.List<IData>) value_;
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, data_list.size()));
for (IData _iter14 : data_list)
@ -271,7 +282,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
}
return;
case DATA_SET:
Set<IData> data_set = (Set<IData>)value_;
java.util.Set<IData> data_set = (java.util.Set<IData>) value_;
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, data_set.size()));
for (IData _iter15 : data_set)
@ -312,41 +323,41 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
}
public List<IData> getDataList() {
public java.util.List<IData> getDataList() {
if (getSetField() == _Fields.DATA_LIST) {
return (List<IData>)getFieldValue();
return (java.util.List<IData>) getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'data_list' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
}
public void setDataList(List<IData> value) {
if (value == null) throw new NullPointerException();
public void setDataList(java.util.List<IData> value) {
setField_ = _Fields.DATA_LIST;
value_ = value;
}
value_ = java.util.Objects.requireNonNull(value, "_Fields.DATA_LIST");
}
public Set<IData> getDataSet() {
public java.util.Set<IData> getDataSet() {
if (getSetField() == _Fields.DATA_SET) {
return (Set<IData>)getFieldValue();
return (java.util.Set<IData>) getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'data_set' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
}
public void setDataSet(Set<IData> value) {
if (value == null) throw new NullPointerException();
public void setDataSet(java.util.Set<IData> value) {
setField_ = _Fields.DATA_SET;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.DATA_SET");
}
public boolean isSetDataList() {
@ -383,7 +394,7 @@ public class IDataCollection extends org.apache.thrift.TUnion<IDataCollection, I
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
java.util.List<Object> list = new java.util.ArrayList<Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {

View File

@ -1,37 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._Fields>, java.io.Serializable, Cloneable, Comparable<ILvl2Data> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ILvl2Data");
private static final org.apache.thrift.protocol.TField IL2_VAL1_FIELD_DESC = new org.apache.thrift.protocol.TField("il2_val1", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField IL2_VAL2_FIELD_DESC = new org.apache.thrift.protocol.TField("il2_val2", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField IL2_VAL2_FIELD_DESC = new org.apache.thrift.protocol.TField("il2_val2", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new ILvl2DataStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new ILvl2DataTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ILvl2DataStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ILvl2DataTupleSchemeFactory();
public String il2_val1; // required
public String il2_val2; // required
public @org.apache.thrift.annotation.Nullable String il2_val1; // required
public @org.apache.thrift.annotation.Nullable String il2_val2; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
IL2_VAL1((short)1, "il2_val1"),
IL2_VAL2((short)2, "il2_val2");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -39,6 +37,7 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
/**
* 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: // IL2_VAL1
@ -63,6 +62,7 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -75,24 +75,26 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.IL2_VAL1, new org.apache.thrift.meta_data.FieldMetaData("il2_val1", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IL2_VAL2, new org.apache.thrift.meta_data.FieldMetaData("il2_val2", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ILvl2Data.class, metaDataMap);
}
@ -120,6 +122,7 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
}
}
@Override
public ILvl2Data deepCopy() {
return new ILvl2Data(this);
}
@ -130,11 +133,12 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
this.il2_val2 = null;
}
@org.apache.thrift.annotation.Nullable
public String getIl2Val1() {
return this.il2_val1;
}
}
public ILvl2Data setIl2Val1(String il2_val1) {
public ILvl2Data setIl2Val1(@org.apache.thrift.annotation.Nullable String il2_val1) {
this.il2_val1 = il2_val1;
return this;
}
@ -154,11 +158,12 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
}
}
@org.apache.thrift.annotation.Nullable
public String getIl2Val2() {
return this.il2_val2;
}
}
public ILvl2Data setIl2Val2(String il2_val2) {
public ILvl2Data setIl2Val2(@org.apache.thrift.annotation.Nullable String il2_val2) {
this.il2_val2 = il2_val2;
return this;
}
@ -178,7 +183,8 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case IL2_VAL1:
if (value == null) {
@ -197,8 +203,10 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case IL2_VAL1:
@ -212,6 +220,7 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -228,8 +237,6 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ILvl2Data)
return this.equals((ILvl2Data)that);
return false;
@ -238,6 +245,8 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
public boolean equals(ILvl2Data that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_il2_val1 = true && this.isSetIl2Val1();
boolean that_present_il2_val1 = true && that.isSetIl2Val1();
@ -283,7 +292,7 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetIl2Val1()).compareTo(other.isSetIl2Val1());
lastComparison = Boolean.compare(isSetIl2Val1(), other.isSetIl2Val1());
if (lastComparison != 0) {
return lastComparison;
}
@ -293,7 +302,7 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetIl2Val2()).compareTo(other.isSetIl2Val2());
lastComparison = Boolean.compare(isSetIl2Val2(), other.isSetIl2Val2());
if (lastComparison != 0) {
return lastComparison;
}
@ -306,6 +315,8 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -314,14 +325,16 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -353,10 +366,10 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (il2_val1 == null) {
throw new TProtocolException("Required field 'il2_val1' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'il2_val1' was not present! Struct: " + toString());
}
if (il2_val2 == null) {
throw new TProtocolException("Required field 'il2_val2' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'il2_val2' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -377,14 +390,16 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
}
}
private static class ILvl2DataStandardSchemeFactory implements SchemeFactory {
private static class ILvl2DataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public ILvl2DataStandardScheme getScheme() {
return new ILvl2DataStandardScheme();
}
}
}
private static class ILvl2DataStandardScheme extends StandardScheme<ILvl2Data> {
private static class ILvl2DataStandardScheme extends org.apache.thrift.scheme.StandardScheme<ILvl2Data> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, ILvl2Data struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -420,8 +435,9 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, ILvl2Data struct) throws org.apache.thrift.TException {
struct.validate();
@ -440,35 +456,36 @@ public class ILvl2Data implements org.apache.thrift.TBase<ILvl2Data, ILvl2Data._
oprot.writeStructEnd();
}
}
}
private static class ILvl2DataTupleSchemeFactory implements SchemeFactory {
private static class ILvl2DataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public ILvl2DataTupleScheme getScheme() {
return new ILvl2DataTupleScheme();
}
}
}
private static class ILvl2DataTupleScheme extends TupleScheme<ILvl2Data> {
private static class ILvl2DataTupleScheme extends org.apache.thrift.scheme.TupleScheme<ILvl2Data> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ILvl2Data struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.il2_val1);
oprot.writeString(struct.il2_val2);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ILvl2Data struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.il2_val1 = iprot.readString();
struct.setIl2Val1IsSet(true);
struct.il2_val2 = iprot.readString();
struct.setIl2Val2IsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,36 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fields>, java.io.Serializable, Cloneable, Comparable<ILvlData> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ILvlData");
private static final org.apache.thrift.protocol.TField LVL2_DATA1_FIELD_DESC = new org.apache.thrift.protocol.TField("lvl2_data1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField LVL2_DATA2_FIELD_DESC = new org.apache.thrift.protocol.TField("lvl2_data2", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField LVL2_DATA2_FIELD_DESC = new org.apache.thrift.protocol.TField("lvl2_data2", org.apache.thrift.protocol.TType.STRUCT, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new ILvlDataStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new ILvlDataTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ILvlDataStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ILvlDataTupleSchemeFactory();
public ILvl2Data lvl2_data1; // optional
public ILvl2Data lvl2_data2; // optional
public @org.apache.thrift.annotation.Nullable ILvl2Data lvl2_data1; // optional
public @org.apache.thrift.annotation.Nullable ILvl2Data lvl2_data2; // 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 {
LVL2_DATA1((short)1, "lvl2_data1"),
LVL2_DATA2((short)2, "lvl2_data2");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -38,6 +37,7 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
/**
* 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: // LVL2_DATA1
@ -62,6 +62,7 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -74,10 +75,12 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
@ -85,14 +88,14 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
// isset id assignments
private static final _Fields optionals[] = {_Fields.LVL2_DATA1, _Fields.LVL2_DATA2};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.LVL2_DATA1, new org.apache.thrift.meta_data.FieldMetaData("lvl2_data1", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ILvl2Data.class)));
tmpMap.put(_Fields.LVL2_DATA2, new org.apache.thrift.meta_data.FieldMetaData("lvl2_data2", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ILvl2Data.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ILvlData.class, metaDataMap);
}
@ -111,6 +114,7 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
}
}
@Override
public ILvlData deepCopy() {
return new ILvlData(this);
}
@ -121,11 +125,12 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
this.lvl2_data2 = null;
}
@org.apache.thrift.annotation.Nullable
public ILvl2Data getLvl2Data1() {
return this.lvl2_data1;
}
}
public ILvlData setLvl2Data1(ILvl2Data lvl2_data1) {
public ILvlData setLvl2Data1(@org.apache.thrift.annotation.Nullable ILvl2Data lvl2_data1) {
this.lvl2_data1 = lvl2_data1;
return this;
}
@ -145,11 +150,12 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
}
}
@org.apache.thrift.annotation.Nullable
public ILvl2Data getLvl2Data2() {
return this.lvl2_data2;
}
}
public ILvlData setLvl2Data2(ILvl2Data lvl2_data2) {
public ILvlData setLvl2Data2(@org.apache.thrift.annotation.Nullable ILvl2Data lvl2_data2) {
this.lvl2_data2 = lvl2_data2;
return this;
}
@ -169,7 +175,8 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case LVL2_DATA1:
if (value == null) {
@ -188,8 +195,10 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case LVL2_DATA1:
@ -203,6 +212,7 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -219,8 +229,6 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ILvlData)
return this.equals((ILvlData)that);
return false;
@ -229,6 +237,8 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
public boolean equals(ILvlData that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_lvl2_data1 = true && this.isSetLvl2Data1();
boolean that_present_lvl2_data1 = true && that.isSetLvl2Data1();
@ -274,7 +284,7 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetLvl2Data1()).compareTo(other.isSetLvl2Data1());
lastComparison = Boolean.compare(isSetLvl2Data1(), other.isSetLvl2Data1());
if (lastComparison != 0) {
return lastComparison;
}
@ -284,7 +294,7 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetLvl2Data2()).compareTo(other.isSetLvl2Data2());
lastComparison = Boolean.compare(isSetLvl2Data2(), other.isSetLvl2Data2());
if (lastComparison != 0) {
return lastComparison;
}
@ -297,6 +307,8 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -305,14 +317,16 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -348,6 +362,12 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (lvl2_data1 != null) {
lvl2_data1.validate();
}
if (lvl2_data2 != null) {
lvl2_data2.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@ -366,14 +386,16 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
}
}
private static class ILvlDataStandardSchemeFactory implements SchemeFactory {
private static class ILvlDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public ILvlDataStandardScheme getScheme() {
return new ILvlDataStandardScheme();
}
}
}
private static class ILvlDataStandardScheme extends StandardScheme<ILvlData> {
private static class ILvlDataStandardScheme extends org.apache.thrift.scheme.StandardScheme<ILvlData> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, ILvlData struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -411,8 +433,9 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, ILvlData struct) throws org.apache.thrift.TException {
struct.validate();
@ -435,20 +458,21 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
oprot.writeStructEnd();
}
}
}
private static class ILvlDataTupleSchemeFactory implements SchemeFactory {
private static class ILvlDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public ILvlDataTupleScheme getScheme() {
return new ILvlDataTupleScheme();
}
}
}
private static class ILvlDataTupleScheme extends TupleScheme<ILvlData> {
private static class ILvlDataTupleScheme extends org.apache.thrift.scheme.TupleScheme<ILvlData> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ILvlData struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetLvl2Data1()) {
optionals.set(0);
}
@ -466,8 +490,8 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ILvlData struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.lvl2_data1 = new ILvl2Data();
struct.lvl2_data1.read(iprot);
@ -479,10 +503,10 @@ public class ILvlData implements org.apache.thrift.TBase<ILvlData, ILvlData._Fie
struct.setLvl2Data2IsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,37 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled, IStatusCanceled._Fields>, java.io.Serializable, Cloneable, Comparable<IStatusCanceled> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IStatusCanceled");
private static final org.apache.thrift.protocol.TField DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("details", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new IStatusCanceledStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new IStatusCanceledTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IStatusCanceledStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IStatusCanceledTupleSchemeFactory();
public String details; // required
public String value; // optional
public @org.apache.thrift.annotation.Nullable String details; // required
public @org.apache.thrift.annotation.Nullable String value; // 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 {
DETAILS((short)1, "details"),
VALUE((short)2, "value");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -39,6 +37,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
/**
* 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: // DETAILS
@ -63,6 +62,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -75,10 +75,12 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
@ -86,14 +88,14 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
// isset id assignments
private static final _Fields optionals[] = {_Fields.VALUE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.DETAILS, new org.apache.thrift.meta_data.FieldMetaData("details", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IStatusCanceled.class, metaDataMap);
}
@ -119,6 +121,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
}
}
@Override
public IStatusCanceled deepCopy() {
return new IStatusCanceled(this);
}
@ -129,11 +132,12 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
this.value = null;
}
@org.apache.thrift.annotation.Nullable
public String getDetails() {
return this.details;
}
}
public IStatusCanceled setDetails(String details) {
public IStatusCanceled setDetails(@org.apache.thrift.annotation.Nullable String details) {
this.details = details;
return this;
}
@ -153,11 +157,12 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
}
}
@org.apache.thrift.annotation.Nullable
public String getValue() {
return this.value;
}
}
public IStatusCanceled setValue(String value) {
public IStatusCanceled setValue(@org.apache.thrift.annotation.Nullable String value) {
this.value = value;
return this;
}
@ -177,7 +182,8 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case DETAILS:
if (value == null) {
@ -196,8 +202,10 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case DETAILS:
@ -211,6 +219,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -227,8 +236,6 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof IStatusCanceled)
return this.equals((IStatusCanceled)that);
return false;
@ -237,6 +244,8 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
public boolean equals(IStatusCanceled that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_details = true && this.isSetDetails();
boolean that_present_details = true && that.isSetDetails();
@ -282,7 +291,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetDetails()).compareTo(other.isSetDetails());
lastComparison = Boolean.compare(isSetDetails(), other.isSetDetails());
if (lastComparison != 0) {
return lastComparison;
}
@ -292,7 +301,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
lastComparison = Boolean.compare(isSetValue(), other.isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
@ -305,6 +314,8 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -313,14 +324,16 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -354,7 +367,7 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (details == null) {
throw new TProtocolException("Required field 'details' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'details' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -375,14 +388,16 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
}
}
private static class IStatusCanceledStandardSchemeFactory implements SchemeFactory {
private static class IStatusCanceledStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IStatusCanceledStandardScheme getScheme() {
return new IStatusCanceledStandardScheme();
}
}
}
private static class IStatusCanceledStandardScheme extends StandardScheme<IStatusCanceled> {
private static class IStatusCanceledStandardScheme extends org.apache.thrift.scheme.StandardScheme<IStatusCanceled> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, IStatusCanceled struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -418,8 +433,9 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, IStatusCanceled struct) throws org.apache.thrift.TException {
struct.validate();
@ -440,21 +456,22 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
oprot.writeStructEnd();
}
}
}
private static class IStatusCanceledTupleSchemeFactory implements SchemeFactory {
private static class IStatusCanceledTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IStatusCanceledTupleScheme getScheme() {
return new IStatusCanceledTupleScheme();
}
}
}
private static class IStatusCanceledTupleScheme extends TupleScheme<IStatusCanceled> {
private static class IStatusCanceledTupleScheme extends org.apache.thrift.scheme.TupleScheme<IStatusCanceled> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, IStatusCanceled struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.details);
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetValue()) {
optionals.set(0);
}
@ -466,19 +483,19 @@ public class IStatusCanceled implements org.apache.thrift.TBase<IStatusCanceled,
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, IStatusCanceled struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.details = iprot.readString();
struct.setDetailsIsSet(true);
BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.value = iprot.readString();
struct.setValueIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,36 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatusPaid._Fields>, java.io.Serializable, Cloneable, Comparable<IStatusPaid> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IStatusPaid");
private static final org.apache.thrift.protocol.TField DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("date", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new IStatusPaidStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new IStatusPaidTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IStatusPaidStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IStatusPaidTupleSchemeFactory();
public String date; // required
public String value; // optional
public @org.apache.thrift.annotation.Nullable String date; // required
public @org.apache.thrift.annotation.Nullable String value; // 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 {
DATE((short)1, "date"),
VALUE((short)2, "value");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -38,6 +37,7 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
/**
* 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: // DATE
@ -62,6 +62,7 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -74,10 +75,12 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
@ -85,14 +88,14 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
// isset id assignments
private static final _Fields optionals[] = {_Fields.VALUE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.DATE, new org.apache.thrift.meta_data.FieldMetaData("date", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IStatusPaid.class, metaDataMap);
}
@ -118,6 +121,7 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
}
}
@Override
public IStatusPaid deepCopy() {
return new IStatusPaid(this);
}
@ -128,11 +132,12 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
this.value = null;
}
@org.apache.thrift.annotation.Nullable
public String getDate() {
return this.date;
}
}
public IStatusPaid setDate(String date) {
public IStatusPaid setDate(@org.apache.thrift.annotation.Nullable String date) {
this.date = date;
return this;
}
@ -152,11 +157,12 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
}
}
@org.apache.thrift.annotation.Nullable
public String getValue() {
return this.value;
}
}
public IStatusPaid setValue(String value) {
public IStatusPaid setValue(@org.apache.thrift.annotation.Nullable String value) {
this.value = value;
return this;
}
@ -176,7 +182,8 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case DATE:
if (value == null) {
@ -195,8 +202,10 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case DATE:
@ -210,6 +219,7 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -226,8 +236,6 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof IStatusPaid)
return this.equals((IStatusPaid)that);
return false;
@ -236,6 +244,8 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
public boolean equals(IStatusPaid that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_date = true && this.isSetDate();
boolean that_present_date = true && that.isSetDate();
@ -281,7 +291,7 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetDate()).compareTo(other.isSetDate());
lastComparison = Boolean.compare(isSetDate(), other.isSetDate());
if (lastComparison != 0) {
return lastComparison;
}
@ -291,7 +301,7 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
lastComparison = Boolean.compare(isSetValue(), other.isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
@ -304,6 +314,8 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -312,14 +324,16 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -371,14 +385,16 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
}
}
private static class IStatusPaidStandardSchemeFactory implements SchemeFactory {
private static class IStatusPaidStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IStatusPaidStandardScheme getScheme() {
return new IStatusPaidStandardScheme();
}
}
}
private static class IStatusPaidStandardScheme extends StandardScheme<IStatusPaid> {
private static class IStatusPaidStandardScheme extends org.apache.thrift.scheme.StandardScheme<IStatusPaid> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, IStatusPaid struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -414,8 +430,9 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, IStatusPaid struct) throws org.apache.thrift.TException {
struct.validate();
@ -436,20 +453,21 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
oprot.writeStructEnd();
}
}
}
private static class IStatusPaidTupleSchemeFactory implements SchemeFactory {
private static class IStatusPaidTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IStatusPaidTupleScheme getScheme() {
return new IStatusPaidTupleScheme();
}
}
}
private static class IStatusPaidTupleScheme extends TupleScheme<IStatusPaid> {
private static class IStatusPaidTupleScheme extends org.apache.thrift.scheme.TupleScheme<IStatusPaid> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, IStatusPaid struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetDate()) {
optionals.set(0);
}
@ -467,8 +485,8 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, IStatusPaid struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.date = iprot.readString();
struct.setDateIsSet(true);
@ -478,10 +496,10 @@ public class IStatusPaid implements org.apache.thrift.TBase<IStatusPaid, IStatus
struct.setValueIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,16 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields>, java.io.Serializable, Cloneable, Comparable<Invoice> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Invoice");
@ -22,20 +20,20 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
private static final org.apache.thrift.protocol.TField I_DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("i_details", org.apache.thrift.protocol.TType.STRING, (short)7);
private static final org.apache.thrift.protocol.TField I_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("i_map", org.apache.thrift.protocol.TType.MAP, (short)8);
private static final org.apache.thrift.protocol.TField OBJ_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("obj_map", org.apache.thrift.protocol.TType.MAP, (short)9);
private static final org.apache.thrift.protocol.TField I_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("i_list", org.apache.thrift.protocol.TType.LIST, (short)10);
private static final org.apache.thrift.protocol.TField I_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("i_list", org.apache.thrift.protocol.TType.LIST, (short) 10);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new InvoiceStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new InvoiceTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new InvoiceStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new InvoiceTupleSchemeFactory();
public int id; // required
public InvoiceStatus status; // required
public IDataCollection data_coll; // optional
public IData data; // required
public ILvlData lvl_data; // required
public String i_details; // optional
public Map<Integer,IData> i_map; // optional
public Map<InvoiceStatus,IData> obj_map; // optional
public List<Integer> i_list; // optional
public @org.apache.thrift.annotation.Nullable InvoiceStatus status; // required
public @org.apache.thrift.annotation.Nullable IDataCollection data_coll; // optional
public @org.apache.thrift.annotation.Nullable IData data; // required
public @org.apache.thrift.annotation.Nullable ILvlData lvl_data; // required
public @org.apache.thrift.annotation.Nullable String i_details; // optional
public @org.apache.thrift.annotation.Nullable java.util.Map<Integer, IData> i_map; // optional
public @org.apache.thrift.annotation.Nullable java.util.Map<InvoiceStatus, IData> obj_map; // optional
public @org.apache.thrift.annotation.Nullable java.util.List<Integer> i_list; // 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 {
@ -49,10 +47,10 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
OBJ_MAP((short)9, "obj_map"),
I_LIST((short)10, "i_list");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -60,6 +58,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
/**
* 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: // ID
@ -98,6 +97,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -110,10 +110,12 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
@ -122,10 +124,10 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
// isset id assignments
private static final int __ID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.DATA_COLL, _Fields.I_DETAILS, _Fields.I_MAP, _Fields.OBJ_MAP, _Fields.I_LIST};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
private static final _Fields optionals[] = {_Fields.DATA_COLL, _Fields.I_DETAILS, _Fields.I_MAP, _Fields.OBJ_MAP, _Fields.I_LIST};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT,
@ -149,7 +151,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
tmpMap.put(_Fields.I_LIST, new org.apache.thrift.meta_data.FieldMetaData("i_list", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Invoice.class, metaDataMap);
}
@ -192,8 +194,8 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
this.i_details = other.i_details;
}
if (other.isSetIMap()) {
Map<Integer,IData> __this__i_map = new HashMap<Integer,IData>(other.i_map.size());
for (Map.Entry<Integer, IData> other_element : other.i_map.entrySet()) {
java.util.Map<Integer, IData> __this__i_map = new java.util.HashMap<Integer, IData>(other.i_map.size());
for (java.util.Map.Entry<Integer, IData> other_element : other.i_map.entrySet()) {
Integer other_element_key = other_element.getKey();
IData other_element_value = other_element.getValue();
@ -207,8 +209,8 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
this.i_map = __this__i_map;
}
if (other.isSetObjMap()) {
Map<InvoiceStatus,IData> __this__obj_map = new HashMap<InvoiceStatus,IData>(other.obj_map.size());
for (Map.Entry<InvoiceStatus, IData> other_element : other.obj_map.entrySet()) {
java.util.Map<InvoiceStatus, IData> __this__obj_map = new java.util.HashMap<InvoiceStatus, IData>(other.obj_map.size());
for (java.util.Map.Entry<InvoiceStatus, IData> other_element : other.obj_map.entrySet()) {
InvoiceStatus other_element_key = other_element.getKey();
IData other_element_value = other_element.getValue();
@ -222,11 +224,12 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
this.obj_map = __this__obj_map;
}
if (other.isSetIList()) {
List<Integer> __this__i_list = new ArrayList<Integer>(other.i_list);
java.util.List<Integer> __this__i_list = new java.util.ArrayList<Integer>(other.i_list);
this.i_list = __this__i_list;
}
}
@Override
public Invoice deepCopy() {
return new Invoice(this);
}
@ -256,23 +259,24 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
public void unsetId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
}
public void setIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public InvoiceStatus getStatus() {
return this.status;
}
}
public Invoice setStatus(InvoiceStatus status) {
public Invoice setStatus(@org.apache.thrift.annotation.Nullable InvoiceStatus status) {
this.status = status;
return this;
}
@ -292,11 +296,12 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
}
@org.apache.thrift.annotation.Nullable
public IDataCollection getDataColl() {
return this.data_coll;
}
}
public Invoice setDataColl(IDataCollection data_coll) {
public Invoice setDataColl(@org.apache.thrift.annotation.Nullable IDataCollection data_coll) {
this.data_coll = data_coll;
return this;
}
@ -316,11 +321,12 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
}
@org.apache.thrift.annotation.Nullable
public IData getData() {
return this.data;
}
}
public Invoice setData(IData data) {
public Invoice setData(@org.apache.thrift.annotation.Nullable IData data) {
this.data = data;
return this;
}
@ -340,11 +346,12 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
}
@org.apache.thrift.annotation.Nullable
public ILvlData getLvlData() {
return this.lvl_data;
}
}
public Invoice setLvlData(ILvlData lvl_data) {
public Invoice setLvlData(@org.apache.thrift.annotation.Nullable ILvlData lvl_data) {
this.lvl_data = lvl_data;
return this;
}
@ -364,11 +371,12 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
}
@org.apache.thrift.annotation.Nullable
public String getIDetails() {
return this.i_details;
}
}
public Invoice setIDetails(String i_details) {
public Invoice setIDetails(@org.apache.thrift.annotation.Nullable String i_details) {
this.i_details = i_details;
return this;
}
@ -394,16 +402,17 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
public void putToIMap(int key, IData val) {
if (this.i_map == null) {
this.i_map = new HashMap<Integer,IData>();
this.i_map = new java.util.HashMap<Integer, IData>();
}
this.i_map.put(key, val);
}
public Map<Integer,IData> getIMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<Integer, IData> getIMap() {
return this.i_map;
}
}
public Invoice setIMap(Map<Integer,IData> i_map) {
public Invoice setIMap(@org.apache.thrift.annotation.Nullable java.util.Map<Integer, IData> i_map) {
this.i_map = i_map;
return this;
}
@ -429,16 +438,17 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
public void putToObjMap(InvoiceStatus key, IData val) {
if (this.obj_map == null) {
this.obj_map = new HashMap<InvoiceStatus,IData>();
this.obj_map = new java.util.HashMap<InvoiceStatus, IData>();
}
this.obj_map.put(key, val);
}
public Map<InvoiceStatus,IData> getObjMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<InvoiceStatus, IData> getObjMap() {
return this.obj_map;
}
}
public Invoice setObjMap(Map<InvoiceStatus,IData> obj_map) {
public Invoice setObjMap(@org.apache.thrift.annotation.Nullable java.util.Map<InvoiceStatus, IData> obj_map) {
this.obj_map = obj_map;
return this;
}
@ -462,22 +472,24 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return (this.i_list == null) ? 0 : this.i_list.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<Integer> getIListIterator() {
return (this.i_list == null) ? null : this.i_list.iterator();
}
public void addToIList(int elem) {
if (this.i_list == null) {
this.i_list = new ArrayList<Integer>();
this.i_list = new java.util.ArrayList<Integer>();
}
this.i_list.add(elem);
}
public List<Integer> getIList() {
@org.apache.thrift.annotation.Nullable
public java.util.List<Integer> getIList() {
return this.i_list;
}
}
public Invoice setIList(List<Integer> i_list) {
public Invoice setIList(@org.apache.thrift.annotation.Nullable java.util.List<Integer> i_list) {
this.i_list = i_list;
return this;
}
@ -497,7 +509,8 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case ID:
if (value == null) {
@ -551,7 +564,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (value == null) {
unsetIMap();
} else {
setIMap((Map<Integer,IData>)value);
setIMap((java.util.Map<Integer, IData>) value);
}
break;
@ -559,7 +572,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (value == null) {
unsetObjMap();
} else {
setObjMap((Map<InvoiceStatus,IData>)value);
setObjMap((java.util.Map<InvoiceStatus, IData>) value);
}
break;
@ -567,13 +580,15 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (value == null) {
unsetIList();
} else {
setIList((List<Integer>)value);
setIList((java.util.List<Integer>) value);
}
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
@ -608,6 +623,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -638,8 +654,6 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Invoice)
return this.equals((Invoice)that);
return false;
@ -648,6 +662,8 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
public boolean equals(Invoice that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_id = true;
boolean that_present_id = true;
@ -782,7 +798,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
lastComparison = Boolean.compare(isSetId(), other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
@ -792,7 +808,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
lastComparison = Boolean.compare(isSetStatus(), other.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
@ -802,7 +818,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDataColl()).compareTo(other.isSetDataColl());
lastComparison = Boolean.compare(isSetDataColl(), other.isSetDataColl());
if (lastComparison != 0) {
return lastComparison;
}
@ -812,7 +828,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
lastComparison = Boolean.compare(isSetData(), other.isSetData());
if (lastComparison != 0) {
return lastComparison;
}
@ -822,7 +838,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetLvlData()).compareTo(other.isSetLvlData());
lastComparison = Boolean.compare(isSetLvlData(), other.isSetLvlData());
if (lastComparison != 0) {
return lastComparison;
}
@ -832,7 +848,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetIDetails()).compareTo(other.isSetIDetails());
lastComparison = Boolean.compare(isSetIDetails(), other.isSetIDetails());
if (lastComparison != 0) {
return lastComparison;
}
@ -842,7 +858,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetIMap()).compareTo(other.isSetIMap());
lastComparison = Boolean.compare(isSetIMap(), other.isSetIMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -852,7 +868,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetObjMap()).compareTo(other.isSetObjMap());
lastComparison = Boolean.compare(isSetObjMap(), other.isSetObjMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -862,7 +878,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetIList()).compareTo(other.isSetIList());
lastComparison = Boolean.compare(isSetIList(), other.isSetIList());
if (lastComparison != 0) {
return lastComparison;
}
@ -875,6 +891,8 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -883,14 +901,16 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -1010,14 +1030,16 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
}
}
private static class InvoiceStandardSchemeFactory implements SchemeFactory {
private static class InvoiceStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public InvoiceStandardScheme getScheme() {
return new InvoiceStandardScheme();
}
}
}
private static class InvoiceStandardScheme extends StandardScheme<Invoice> {
private static class InvoiceStandardScheme extends org.apache.thrift.scheme.StandardScheme<Invoice> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Invoice struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -1084,9 +1106,9 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
struct.i_map = new HashMap<Integer,IData>(2*_map16.size);
struct.i_map = new java.util.HashMap<Integer, IData>(2 * _map16.size);
int _key17;
IData _val18;
@org.apache.thrift.annotation.Nullable IData _val18;
for (int _i19 = 0; _i19 < _map16.size; ++_i19)
{
_key17 = iprot.readI32();
@ -1105,9 +1127,9 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
struct.obj_map = new HashMap<InvoiceStatus,IData>(2*_map20.size);
InvoiceStatus _key21;
IData _val22;
struct.obj_map = new java.util.HashMap<InvoiceStatus, IData>(2 * _map20.size);
@org.apache.thrift.annotation.Nullable InvoiceStatus _key21;
@org.apache.thrift.annotation.Nullable IData _val22;
for (int _i23 = 0; _i23 < _map20.size; ++_i23)
{
_key21 = new InvoiceStatus();
@ -1127,7 +1149,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
struct.i_list = new ArrayList<Integer>(_list24.size);
struct.i_list = new java.util.ArrayList<Integer>(_list24.size);
int _elem25;
for (int _i26 = 0; _i26 < _list24.size; ++_i26)
{
@ -1150,8 +1172,9 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Invoice struct) throws org.apache.thrift.TException {
struct.validate();
@ -1193,7 +1216,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
oprot.writeFieldBegin(I_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.i_map.size()));
for (Map.Entry<Integer, IData> _iter27 : struct.i_map.entrySet())
for (java.util.Map.Entry<Integer, IData> _iter27 : struct.i_map.entrySet())
{
oprot.writeI32(_iter27.getKey());
_iter27.getValue().write(oprot);
@ -1208,7 +1231,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
oprot.writeFieldBegin(OBJ_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, struct.obj_map.size()));
for (Map.Entry<InvoiceStatus, IData> _iter28 : struct.obj_map.entrySet())
for (java.util.Map.Entry<InvoiceStatus, IData> _iter28 : struct.obj_map.entrySet())
{
_iter28.getKey().write(oprot);
_iter28.getValue().write(oprot);
@ -1236,20 +1259,21 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
oprot.writeStructEnd();
}
}
}
private static class InvoiceTupleSchemeFactory implements SchemeFactory {
private static class InvoiceTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public InvoiceTupleScheme getScheme() {
return new InvoiceTupleScheme();
}
}
}
private static class InvoiceTupleScheme extends TupleScheme<Invoice> {
private static class InvoiceTupleScheme extends org.apache.thrift.scheme.TupleScheme<Invoice> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Invoice struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetId()) {
optionals.set(0);
}
@ -1299,7 +1323,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (struct.isSetIMap()) {
{
oprot.writeI32(struct.i_map.size());
for (Map.Entry<Integer, IData> _iter30 : struct.i_map.entrySet())
for (java.util.Map.Entry<Integer, IData> _iter30 : struct.i_map.entrySet())
{
oprot.writeI32(_iter30.getKey());
_iter30.getValue().write(oprot);
@ -1309,7 +1333,7 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
if (struct.isSetObjMap()) {
{
oprot.writeI32(struct.obj_map.size());
for (Map.Entry<InvoiceStatus, IData> _iter31 : struct.obj_map.entrySet())
for (java.util.Map.Entry<InvoiceStatus, IData> _iter31 : struct.obj_map.entrySet())
{
_iter31.getKey().write(oprot);
_iter31.getValue().write(oprot);
@ -1329,8 +1353,8 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Invoice struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(9);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(9);
if (incoming.get(0)) {
struct.id = iprot.readI32();
struct.setIdIsSet(true);
@ -1360,11 +1384,11 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
struct.setIDetailsIsSet(true);
}
if (incoming.get(6)) {
{
org.apache.thrift.protocol.TMap _map33 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.i_map = new HashMap<Integer,IData>(2*_map33.size);
{
org.apache.thrift.protocol.TMap _map33 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT);
struct.i_map = new java.util.HashMap<Integer, IData>(2 * _map33.size);
int _key34;
IData _val35;
@org.apache.thrift.annotation.Nullable IData _val35;
for (int _i36 = 0; _i36 < _map33.size; ++_i36)
{
_key34 = iprot.readI32();
@ -1376,11 +1400,11 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
struct.setIMapIsSet(true);
}
if (incoming.get(7)) {
{
org.apache.thrift.protocol.TMap _map37 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.obj_map = new HashMap<InvoiceStatus,IData>(2*_map37.size);
InvoiceStatus _key38;
IData _val39;
{
org.apache.thrift.protocol.TMap _map37 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRUCT);
struct.obj_map = new java.util.HashMap<InvoiceStatus, IData>(2 * _map37.size);
@org.apache.thrift.annotation.Nullable InvoiceStatus _key38;
@org.apache.thrift.annotation.Nullable IData _val39;
for (int _i40 = 0; _i40 < _map37.size; ++_i40)
{
_key38 = new InvoiceStatus();
@ -1393,9 +1417,9 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
struct.setObjMapIsSet(true);
}
if (incoming.get(8)) {
{
org.apache.thrift.protocol.TList _list41 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
struct.i_list = new ArrayList<Integer>(_list41.size);
{
org.apache.thrift.protocol.TList _list41 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
struct.i_list = new java.util.ArrayList<Integer>(_list41.size);
int _elem42;
for (int _i43 = 0; _i43 < _list41.size; ++_i43)
{
@ -1406,10 +1430,10 @@ public class Invoice implements org.apache.thrift.TBase<Invoice, Invoice._Fields
struct.setIListIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,9 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TProtocolException;
import java.util.*;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, InvoiceStatus._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvoiceStatus");
private static final org.apache.thrift.protocol.TField PAID_FIELD_DESC = new org.apache.thrift.protocol.TField("paid", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@ -14,10 +19,10 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
PAID((short)1, "paid"),
CANCELED((short)2, "canceled");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -25,6 +30,7 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
/**
* 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: // PAID
@ -49,6 +55,7 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -61,23 +68,25 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.PAID, new org.apache.thrift.meta_data.FieldMetaData("paid", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IStatusPaid.class)));
tmpMap.put(_Fields.CANCELED, new org.apache.thrift.meta_data.FieldMetaData("canceled", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IStatusCanceled.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InvoiceStatus.class, metaDataMap);
}
@ -92,6 +101,8 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
public InvoiceStatus(InvoiceStatus other) {
super(other);
}
@Override
public InvoiceStatus deepCopy() {
return new InvoiceStatus(this);
}
@ -196,7 +207,7 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new TProtocolException("Couldn't find a field with field id " + fieldID);
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@ -242,10 +253,12 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -260,9 +273,8 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
}
public void setPaid(IStatusPaid value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.PAID;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.PAID");
}
public IStatusCanceled getCanceled() {
@ -274,9 +286,8 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
}
public void setCanceled(IStatusCanceled value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.CANCELED;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.CANCELED");
}
public boolean isSetPaid() {
@ -313,7 +324,7 @@ public class InvoiceStatus extends org.apache.thrift.TUnion<InvoiceStatus, Invoi
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
java.util.List<Object> list = new java.util.ArrayList<Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {

View File

@ -1,33 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.filter.test.filter;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields>, java.io.Serializable, Cloneable, Comparable<MapTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MapTest");
private static final org.apache.thrift.protocol.TField LST_KEY_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("lst_key_map", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField LST_KEY_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("lst_key_map", org.apache.thrift.protocol.TType.MAP, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new MapTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new MapTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new MapTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new MapTestTupleSchemeFactory();
public Map<List<IData>,Integer> lst_key_map; // optional
public @org.apache.thrift.annotation.Nullable java.util.Map<java.util.List<IData>, Integer> lst_key_map; // 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 {
LST_KEY_MAP((short)1, "lst_key_map");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -35,6 +34,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
/**
* 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: // LST_KEY_MAP
@ -57,6 +57,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(String name) {
return byName.get(name);
}
@ -69,10 +70,12 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
@Override
public String getFieldName() {
return _fieldName;
}
@ -80,15 +83,15 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
// isset id assignments
private static final _Fields optionals[] = {_Fields.LST_KEY_MAP};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.LST_KEY_MAP, new org.apache.thrift.meta_data.FieldMetaData("lst_key_map", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IData.class)),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MapTest.class, metaDataMap);
}
@ -100,13 +103,13 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
*/
public MapTest(MapTest other) {
if (other.isSetLstKeyMap()) {
Map<List<IData>,Integer> __this__lst_key_map = new HashMap<List<IData>,Integer>(other.lst_key_map.size());
for (Map.Entry<List<IData>, Integer> other_element : other.lst_key_map.entrySet()) {
java.util.Map<java.util.List<IData>, Integer> __this__lst_key_map = new java.util.HashMap<java.util.List<IData>, Integer>(other.lst_key_map.size());
for (java.util.Map.Entry<java.util.List<IData>, Integer> other_element : other.lst_key_map.entrySet()) {
List<IData> other_element_key = other_element.getKey();
java.util.List<IData> other_element_key = other_element.getKey();
Integer other_element_value = other_element.getValue();
List<IData> __this__lst_key_map_copy_key = new ArrayList<IData>(other_element_key.size());
java.util.List<IData> __this__lst_key_map_copy_key = new java.util.ArrayList<IData>(other_element_key.size());
for (IData other_element_key_element : other_element_key) {
__this__lst_key_map_copy_key.add(new IData(other_element_key_element));
}
@ -119,6 +122,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
}
@Override
public MapTest deepCopy() {
return new MapTest(this);
}
@ -132,18 +136,19 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return (this.lst_key_map == null) ? 0 : this.lst_key_map.size();
}
public void putToLstKeyMap(List<IData> key, int val) {
public void putToLstKeyMap(java.util.List<IData> key, int val) {
if (this.lst_key_map == null) {
this.lst_key_map = new HashMap<List<IData>,Integer>();
this.lst_key_map = new java.util.HashMap<java.util.List<IData>, Integer>();
}
this.lst_key_map.put(key, val);
}
}
public Map<List<IData>,Integer> getLstKeyMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<java.util.List<IData>, Integer> getLstKeyMap() {
return this.lst_key_map;
}
}
public MapTest setLstKeyMap(Map<List<IData>,Integer> lst_key_map) {
public MapTest setLstKeyMap(@org.apache.thrift.annotation.Nullable java.util.Map<java.util.List<IData>, Integer> lst_key_map) {
this.lst_key_map = lst_key_map;
return this;
}
@ -163,19 +168,22 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable Object value) {
switch (field) {
case LST_KEY_MAP:
if (value == null) {
unsetLstKeyMap();
} else {
setLstKeyMap((Map<List<IData>,Integer>)value);
setLstKeyMap((java.util.Map<java.util.List<IData>, Integer>) value);
}
break;
}
}
}
@org.apache.thrift.annotation.Nullable
@Override
public Object getFieldValue(_Fields field) {
switch (field) {
case LST_KEY_MAP:
@ -186,6 +194,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
@ -200,8 +209,6 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof MapTest)
return this.equals((MapTest)that);
return false;
@ -210,6 +217,8 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
public boolean equals(MapTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_lst_key_map = true && this.isSetLstKeyMap();
boolean that_present_lst_key_map = true && that.isSetLstKeyMap();
@ -242,7 +251,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetLstKeyMap()).compareTo(other.isSetLstKeyMap());
lastComparison = Boolean.compare(isSetLstKeyMap(), other.isSetLstKeyMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -255,6 +264,8 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -263,14 +274,16 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@ -314,14 +327,16 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
}
private static class MapTestStandardSchemeFactory implements SchemeFactory {
private static class MapTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public MapTestStandardScheme getScheme() {
return new MapTestStandardScheme();
}
}
}
private static class MapTestStandardScheme extends StandardScheme<MapTest> {
private static class MapTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<MapTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, MapTest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -336,15 +351,15 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map44 = iprot.readMapBegin();
struct.lst_key_map = new HashMap<List<IData>,Integer>(2*_map44.size);
List<IData> _key45;
struct.lst_key_map = new java.util.HashMap<java.util.List<IData>, Integer>(2 * _map44.size);
@org.apache.thrift.annotation.Nullable java.util.List<IData> _key45;
int _val46;
for (int _i47 = 0; _i47 < _map44.size; ++_i47)
{
{
org.apache.thrift.protocol.TList _list48 = iprot.readListBegin();
_key45 = new ArrayList<IData>(_list48.size);
IData _elem49;
_key45 = new java.util.ArrayList<IData>(_list48.size);
@org.apache.thrift.annotation.Nullable IData _elem49;
for (int _i50 = 0; _i50 < _list48.size; ++_i50)
{
_elem49 = new IData();
@ -372,8 +387,9 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, MapTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -383,7 +399,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
oprot.writeFieldBegin(LST_KEY_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.I32, struct.lst_key_map.size()));
for (Map.Entry<List<IData>, Integer> _iter51 : struct.lst_key_map.entrySet())
for (java.util.Map.Entry<java.util.List<IData>, Integer> _iter51 : struct.lst_key_map.entrySet())
{
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter51.getKey().size()));
@ -404,20 +420,21 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
oprot.writeStructEnd();
}
}
}
private static class MapTestTupleSchemeFactory implements SchemeFactory {
private static class MapTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public MapTestTupleScheme getScheme() {
return new MapTestTupleScheme();
}
}
}
private static class MapTestTupleScheme extends TupleScheme<MapTest> {
private static class MapTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<MapTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, MapTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetLstKeyMap()) {
optionals.set(0);
}
@ -425,7 +442,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (struct.isSetLstKeyMap()) {
{
oprot.writeI32(struct.lst_key_map.size());
for (Map.Entry<List<IData>, Integer> _iter53 : struct.lst_key_map.entrySet())
for (java.util.Map.Entry<java.util.List<IData>, Integer> _iter53 : struct.lst_key_map.entrySet())
{
{
oprot.writeI32(_iter53.getKey().size());
@ -442,20 +459,20 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, MapTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map55 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.I32, iprot.readI32());
struct.lst_key_map = new HashMap<List<IData>,Integer>(2*_map55.size);
List<IData> _key56;
{
org.apache.thrift.protocol.TMap _map55 = iprot.readMapBegin(org.apache.thrift.protocol.TType.LIST, org.apache.thrift.protocol.TType.I32);
struct.lst_key_map = new java.util.HashMap<java.util.List<IData>, Integer>(2 * _map55.size);
@org.apache.thrift.annotation.Nullable java.util.List<IData> _key56;
int _val57;
for (int _i58 = 0; _i58 < _map55.size; ++_i58)
{
{
org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
_key56 = new ArrayList<IData>(_list59.size);
IData _elem60;
{
org.apache.thrift.protocol.TList _list59 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
_key56 = new java.util.ArrayList<IData>(_list59.size);
@org.apache.thrift.annotation.Nullable IData _elem60;
for (int _i61 = 0; _i61 < _list59.size; ++_i61)
{
_elem60 = new IData();
@ -470,10 +487,10 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
struct.setLstKeyMapIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -5,7 +5,9 @@ struct TestObject {
2: required Ids other_ids
3: required Status status
4: required Type type
5: optional slist words
// https://github.com/apache/thrift/blob/master/CHANGES.md#compiler-general-3
// в 9 версии как depracated, в 17 удален
// 5: optional slist words
6: optional list<i64> numbers
7: optional list<Ids> list_ids
8: optional list<list<Status>> statuses
@ -40,7 +42,9 @@ struct Unknown {
}
union UnknownType {
1: slist result
// https://github.com/apache/thrift/blob/master/CHANGES.md#compiler-general-3
// в 9 версии как depracated, в 17 удален
// 1: slist result
2: list<Type> resultTypes
3: double value
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>dev.vality.geck</groupId>
<artifactId>parent</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

31
pom.xml
View File

@ -7,17 +7,24 @@
<parent>
<groupId>dev.vality</groupId>
<artifactId>library-parent-pom</artifactId>
<version>1.0.2</version>
<version>2.0.2</version>
</parent>
<groupId>dev.vality.geck</groupId>
<artifactId>parent</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>Geck</name>
<description>A set of tools for serializing, migrating, filtering and generating thrift objects.</description>
<url>https://github.com/rbkmoney/geck.git</url>
<url>https://github.com/valitydev/geck.git</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
@ -41,9 +48,10 @@
</modules>
<properties>
<damsel.version>1.543-98ca5c1</damsel.version>
<cds-proto.version>1.66-01353ce</cds-proto.version>
<woody.version>1.0.4</woody.version>
<damsel.version>1.639-4856124</damsel.version>
<cds-proto.version>1.71-b3db02c</cds-proto.version>
<woody.version>2.0.1</woody.version>
<jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version>
</properties>
<dependencyManagement>
@ -102,7 +110,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
@ -113,7 +121,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
@ -122,6 +130,11 @@
<version>3.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation-api.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -134,7 +147,7 @@
<version>0.10.0</version>
<configuration>
<thriftExecutable>thrift</thriftExecutable>
<generator>java:fullcamel</generator>
<generator>java:fullcamel,jakarta_annotations</generator>
</configuration>
<executions>
<execution>

View File

@ -7,7 +7,7 @@
<parent>
<groupId>dev.vality.geck</groupId>
<artifactId>parent</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -26,12 +26,10 @@
<dependency>
<groupId>dev.vality.woody</groupId>
<artifactId>libthrift</artifactId>
<version>${woody.version}</version>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
<artifactId>damsel</artifactId>
<version>${damsel.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -51,9 +49,9 @@
<artifactId>json-utils</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.1</version>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@ -102,6 +100,7 @@
<artifactId>thrift-maven-plugin</artifactId>
<configuration>
<thriftExecutable>thrift</thriftExecutable>
<generator>java:fullcamel,jakarta_annotations</generator>
</configuration>
<executions>
<execution>

View File

@ -120,7 +120,7 @@ public class MockTBaseProcessor extends TBaseProcessor {
MapMetaData mapMetaData = TypeUtil.convertType(MapMetaData.class, valueMetaData);
processMap(mapMetaData, handler);
break;
case ENUM:
case ENUM, OLD_ENUM:
Class<? extends TEnum> tEnumClass = ((EnumMetaData) valueMetaData).getEnumClass();
handler.value(valueGenerator.getTEnum(tEnumClass).toString());
break;

View File

@ -292,12 +292,14 @@ public class TBaseHandler<R extends TBase> implements StructHandler<R> {
FieldValueMetaData valueMetaData = getChildValueMetaData();
ThriftType type = ThriftType.findByMetaData(valueMetaData);
if (type == ThriftType.ENUM) {
if (type == ThriftType.OLD_ENUM) {
Class enumClass = ((EnumMetaData) valueMetaData).getEnumClass();
value(Enum.valueOf(enumClass, value), ThriftType.OLD_ENUM);
} else if (type == ThriftType.ENUM) {
Class enumClass = ((EnumMetaData) valueMetaData).getEnumClass();
value(Enum.valueOf(enumClass, value), ThriftType.ENUM);
} else {
value(value, ThriftType.STRING);
}
}

View File

@ -109,7 +109,7 @@ public class TBaseProcessor implements StructProcessor<TBase> {
case DOUBLE:
handler.value((double) object);
break;
case ENUM:
case ENUM, OLD_ENUM:
handler.value(object.toString());
break;
case BINARY:

View File

@ -5,7 +5,7 @@ import org.apache.thrift.protocol.TType;
public enum ThriftType {
NULL(-1),
NULL(-2),
BOOLEAN(TType.BOOL),
BYTE(TType.BYTE),
DOUBLE(TType.DOUBLE),
@ -14,6 +14,8 @@ public enum ThriftType {
LONG(TType.I64),
STRING(TType.STRING),
ENUM(TType.ENUM),
// если в гек сунуть трифт uuid все сломается , тк старый энам пересекается с новым uuid
OLD_ENUM(TType.UUID),
LIST(TType.LIST),
SET(TType.SET),
MAP(TType.MAP),

View File

@ -1,32 +1,29 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.nio.ByteBuffer;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTest._Fields>, java.io.Serializable, Cloneable, Comparable<BinaryTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BinaryTest");
private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField DATA_IN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("dataInList", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField DATA_IN_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("dataInSet", org.apache.thrift.protocol.TType.SET, (short)3);
private static final org.apache.thrift.protocol.TField DATA_IN_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("dataInMap", org.apache.thrift.protocol.TType.MAP, (short)4);
private static final org.apache.thrift.protocol.TField DATA_IN_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("dataInMap", org.apache.thrift.protocol.TType.MAP, (short) 4);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new BinaryTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new BinaryTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new BinaryTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new BinaryTestTupleSchemeFactory();
public ByteBuffer data; // required
public List<ByteBuffer> dataInList; // required
public Set<ByteBuffer> dataInSet; // required
public Map<ByteBuffer,ByteBuffer> dataInMap; // required
public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer data; // required
public @org.apache.thrift.annotation.Nullable java.util.List<java.nio.ByteBuffer> dataInList; // required
public @org.apache.thrift.annotation.Nullable java.util.Set<java.nio.ByteBuffer> dataInSet; // required
public @org.apache.thrift.annotation.Nullable java.util.Map<java.nio.ByteBuffer, java.nio.ByteBuffer> dataInMap; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -35,10 +32,10 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
DATA_IN_SET((short)3, "dataInSet"),
DATA_IN_MAP((short)4, "dataInMap");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -46,6 +43,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
/**
* 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: // DATA
@ -67,38 +65,41 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.DATA_IN_LIST, new org.apache.thrift.meta_data.FieldMetaData("dataInList", org.apache.thrift.TFieldRequirementType.REQUIRED,
@ -111,7 +112,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BinaryTest.class, metaDataMap);
}
@ -119,10 +120,10 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
}
public BinaryTest(
ByteBuffer data,
List<ByteBuffer> dataInList,
Set<ByteBuffer> dataInSet,
Map<ByteBuffer,ByteBuffer> dataInMap)
java.nio.ByteBuffer data,
java.util.List<java.nio.ByteBuffer> dataInList,
java.util.Set<java.nio.ByteBuffer> dataInSet,
java.util.Map<java.nio.ByteBuffer, java.nio.ByteBuffer> dataInMap)
{
this();
this.data = org.apache.thrift.TBaseHelper.copyBinary(data);
@ -139,19 +140,20 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
}
if (other.isSetDataInList()) {
List<ByteBuffer> __this__dataInList = new ArrayList<ByteBuffer>(other.dataInList);
java.util.List<java.nio.ByteBuffer> __this__dataInList = new java.util.ArrayList<java.nio.ByteBuffer>(other.dataInList);
this.dataInList = __this__dataInList;
}
if (other.isSetDataInSet()) {
Set<ByteBuffer> __this__dataInSet = new HashSet<ByteBuffer>(other.dataInSet);
java.util.Set<java.nio.ByteBuffer> __this__dataInSet = new java.util.HashSet<java.nio.ByteBuffer>(other.dataInSet);
this.dataInSet = __this__dataInSet;
}
if (other.isSetDataInMap()) {
Map<ByteBuffer,ByteBuffer> __this__dataInMap = new HashMap<ByteBuffer,ByteBuffer>(other.dataInMap);
java.util.Map<java.nio.ByteBuffer, java.nio.ByteBuffer> __this__dataInMap = new java.util.HashMap<java.nio.ByteBuffer, java.nio.ByteBuffer>(other.dataInMap);
this.dataInMap = __this__dataInMap;
}
}
@Override
public BinaryTest deepCopy() {
return new BinaryTest(this);
}
@ -169,16 +171,16 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return data == null ? null : data.array();
}
public ByteBuffer bufferForData() {
public java.nio.ByteBuffer bufferForData() {
return org.apache.thrift.TBaseHelper.copyBinary(data);
}
public BinaryTest setData(byte[] data) {
this.data = data == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(data, data.length));
this.data = data == null ? (java.nio.ByteBuffer) null : java.nio.ByteBuffer.wrap(data.clone());
return this;
}
public BinaryTest setData(ByteBuffer data) {
public BinaryTest setData(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer data) {
this.data = org.apache.thrift.TBaseHelper.copyBinary(data);
return this;
}
@ -202,22 +204,24 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return (this.dataInList == null) ? 0 : this.dataInList.size();
}
public java.util.Iterator<ByteBuffer> getDataInListIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.nio.ByteBuffer> getDataInListIterator() {
return (this.dataInList == null) ? null : this.dataInList.iterator();
}
}
public void addToDataInList(ByteBuffer elem) {
public void addToDataInList(java.nio.ByteBuffer elem) {
if (this.dataInList == null) {
this.dataInList = new ArrayList<ByteBuffer>();
this.dataInList = new java.util.ArrayList<java.nio.ByteBuffer>();
}
this.dataInList.add(elem);
}
}
public List<ByteBuffer> getDataInList() {
@org.apache.thrift.annotation.Nullable
public java.util.List<java.nio.ByteBuffer> getDataInList() {
return this.dataInList;
}
}
public BinaryTest setDataInList(List<ByteBuffer> dataInList) {
public BinaryTest setDataInList(@org.apache.thrift.annotation.Nullable java.util.List<java.nio.ByteBuffer> dataInList) {
this.dataInList = dataInList;
return this;
}
@ -241,22 +245,24 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return (this.dataInSet == null) ? 0 : this.dataInSet.size();
}
public java.util.Iterator<ByteBuffer> getDataInSetIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.nio.ByteBuffer> getDataInSetIterator() {
return (this.dataInSet == null) ? null : this.dataInSet.iterator();
}
}
public void addToDataInSet(ByteBuffer elem) {
public void addToDataInSet(java.nio.ByteBuffer elem) {
if (this.dataInSet == null) {
this.dataInSet = new HashSet<ByteBuffer>();
this.dataInSet = new java.util.HashSet<java.nio.ByteBuffer>();
}
this.dataInSet.add(elem);
}
}
public Set<ByteBuffer> getDataInSet() {
@org.apache.thrift.annotation.Nullable
public java.util.Set<java.nio.ByteBuffer> getDataInSet() {
return this.dataInSet;
}
}
public BinaryTest setDataInSet(Set<ByteBuffer> dataInSet) {
public BinaryTest setDataInSet(@org.apache.thrift.annotation.Nullable java.util.Set<java.nio.ByteBuffer> dataInSet) {
this.dataInSet = dataInSet;
return this;
}
@ -280,18 +286,19 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return (this.dataInMap == null) ? 0 : this.dataInMap.size();
}
public void putToDataInMap(ByteBuffer key, ByteBuffer val) {
public void putToDataInMap(java.nio.ByteBuffer key, java.nio.ByteBuffer val) {
if (this.dataInMap == null) {
this.dataInMap = new HashMap<ByteBuffer,ByteBuffer>();
this.dataInMap = new java.util.HashMap<java.nio.ByteBuffer, java.nio.ByteBuffer>();
}
this.dataInMap.put(key, val);
}
}
public Map<ByteBuffer,ByteBuffer> getDataInMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<java.nio.ByteBuffer, java.nio.ByteBuffer> getDataInMap() {
return this.dataInMap;
}
}
public BinaryTest setDataInMap(Map<ByteBuffer,ByteBuffer> dataInMap) {
public BinaryTest setDataInMap(@org.apache.thrift.annotation.Nullable java.util.Map<java.nio.ByteBuffer, java.nio.ByteBuffer> dataInMap) {
this.dataInMap = dataInMap;
return this;
}
@ -311,7 +318,8 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case DATA:
if (value == null) {
@ -320,7 +328,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (value instanceof byte[]) {
setData((byte[])value);
} else {
setData((ByteBuffer)value);
setData((java.nio.ByteBuffer) value);
}
}
break;
@ -329,7 +337,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (value == null) {
unsetDataInList();
} else {
setDataInList((List<ByteBuffer>)value);
setDataInList((java.util.List<java.nio.ByteBuffer>) value);
}
break;
@ -337,7 +345,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (value == null) {
unsetDataInSet();
} else {
setDataInSet((Set<ByteBuffer>)value);
setDataInSet((java.util.Set<java.nio.ByteBuffer>) value);
}
break;
@ -345,14 +353,16 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (value == null) {
unsetDataInMap();
} else {
setDataInMap((Map<ByteBuffer,ByteBuffer>)value);
setDataInMap((java.util.Map<java.nio.ByteBuffer, java.nio.ByteBuffer>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case DATA:
return getData();
@ -367,13 +377,14 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return getDataInMap();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -386,13 +397,11 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
case DATA_IN_MAP:
return isSetDataInMap();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof BinaryTest)
return this.equals((BinaryTest)that);
return false;
@ -401,6 +410,8 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
public boolean equals(BinaryTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_data = true && this.isSetData();
boolean that_present_data = true && that.isSetData();
@ -472,7 +483,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
lastComparison = java.lang.Boolean.compare(isSetData(), other.isSetData());
if (lastComparison != 0) {
return lastComparison;
}
@ -482,7 +493,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDataInList()).compareTo(other.isSetDataInList());
lastComparison = java.lang.Boolean.compare(isSetDataInList(), other.isSetDataInList());
if (lastComparison != 0) {
return lastComparison;
}
@ -492,7 +503,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDataInSet()).compareTo(other.isSetDataInSet());
lastComparison = java.lang.Boolean.compare(isSetDataInSet(), other.isSetDataInSet());
if (lastComparison != 0) {
return lastComparison;
}
@ -502,7 +513,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDataInMap()).compareTo(other.isSetDataInMap());
lastComparison = java.lang.Boolean.compare(isSetDataInMap(), other.isSetDataInMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -515,6 +526,8 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -523,21 +536,23 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("BinaryTest(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("BinaryTest(");
boolean first = true;
sb.append("data:");
@ -578,16 +593,16 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (data == null) {
throw new TProtocolException("Required field 'data' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'data' was not present! Struct: " + toString());
}
if (dataInList == null) {
throw new TProtocolException("Required field 'dataInList' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataInList' was not present! Struct: " + toString());
}
if (dataInSet == null) {
throw new TProtocolException("Required field 'dataInSet' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataInSet' was not present! Struct: " + toString());
}
if (dataInMap == null) {
throw new TProtocolException("Required field 'dataInMap' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataInMap' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -600,22 +615,24 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 BinaryTestStandardSchemeFactory implements SchemeFactory {
private static class BinaryTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public BinaryTestStandardScheme getScheme() {
return new BinaryTestStandardScheme();
}
}
}
private static class BinaryTestStandardScheme extends StandardScheme<BinaryTest> {
private static class BinaryTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<BinaryTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, BinaryTest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -638,8 +655,8 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list142 = iprot.readListBegin();
struct.dataInList = new ArrayList<ByteBuffer>(_list142.size);
ByteBuffer _elem143;
struct.dataInList = new java.util.ArrayList<java.nio.ByteBuffer>(_list142.size);
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem143;
for (int _i144 = 0; _i144 < _list142.size; ++_i144)
{
_elem143 = iprot.readBinary();
@ -656,8 +673,8 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set145 = iprot.readSetBegin();
struct.dataInSet = new HashSet<ByteBuffer>(2*_set145.size);
ByteBuffer _elem146;
struct.dataInSet = new java.util.HashSet<java.nio.ByteBuffer>(2 * _set145.size);
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem146;
for (int _i147 = 0; _i147 < _set145.size; ++_i147)
{
_elem146 = iprot.readBinary();
@ -674,9 +691,9 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map148 = iprot.readMapBegin();
struct.dataInMap = new HashMap<ByteBuffer,ByteBuffer>(2*_map148.size);
ByteBuffer _key149;
ByteBuffer _val150;
struct.dataInMap = new java.util.HashMap<java.nio.ByteBuffer, java.nio.ByteBuffer>(2 * _map148.size);
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _key149;
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _val150;
for (int _i151 = 0; _i151 < _map148.size; ++_i151)
{
_key149 = iprot.readBinary();
@ -699,8 +716,9 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, BinaryTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -714,7 +732,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
oprot.writeFieldBegin(DATA_IN_LIST_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.dataInList.size()));
for (ByteBuffer _iter152 : struct.dataInList)
for (java.nio.ByteBuffer _iter152 : struct.dataInList)
{
oprot.writeBinary(_iter152);
}
@ -726,7 +744,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
oprot.writeFieldBegin(DATA_IN_SET_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.dataInSet.size()));
for (ByteBuffer _iter153 : struct.dataInSet)
for (java.nio.ByteBuffer _iter153 : struct.dataInSet)
{
oprot.writeBinary(_iter153);
}
@ -738,7 +756,7 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
oprot.writeFieldBegin(DATA_IN_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.dataInMap.size()));
for (Map.Entry<ByteBuffer, ByteBuffer> _iter154 : struct.dataInMap.entrySet())
for (java.util.Map.Entry<java.nio.ByteBuffer, java.nio.ByteBuffer> _iter154 : struct.dataInMap.entrySet())
{
oprot.writeBinary(_iter154.getKey());
oprot.writeBinary(_iter154.getValue());
@ -751,37 +769,38 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
oprot.writeStructEnd();
}
}
}
private static class BinaryTestTupleSchemeFactory implements SchemeFactory {
private static class BinaryTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public BinaryTestTupleScheme getScheme() {
return new BinaryTestTupleScheme();
}
}
}
private static class BinaryTestTupleScheme extends TupleScheme<BinaryTest> {
private static class BinaryTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<BinaryTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, BinaryTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeBinary(struct.data);
{
oprot.writeI32(struct.dataInList.size());
for (ByteBuffer _iter155 : struct.dataInList)
for (java.nio.ByteBuffer _iter155 : struct.dataInList)
{
oprot.writeBinary(_iter155);
}
}
{
oprot.writeI32(struct.dataInSet.size());
for (ByteBuffer _iter156 : struct.dataInSet)
for (java.nio.ByteBuffer _iter156 : struct.dataInSet)
{
oprot.writeBinary(_iter156);
}
}
{
oprot.writeI32(struct.dataInMap.size());
for (Map.Entry<ByteBuffer, ByteBuffer> _iter157 : struct.dataInMap.entrySet())
for (java.util.Map.Entry<java.nio.ByteBuffer, java.nio.ByteBuffer> _iter157 : struct.dataInMap.entrySet())
{
oprot.writeBinary(_iter157.getKey());
oprot.writeBinary(_iter157.getValue());
@ -791,13 +810,13 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, BinaryTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.data = iprot.readBinary();
struct.setDataIsSet(true);
{
org.apache.thrift.protocol.TList _list158 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.dataInList = new ArrayList<ByteBuffer>(_list158.size);
ByteBuffer _elem159;
{
org.apache.thrift.protocol.TList _list158 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
struct.dataInList = new java.util.ArrayList<java.nio.ByteBuffer>(_list158.size);
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem159;
for (int _i160 = 0; _i160 < _list158.size; ++_i160)
{
_elem159 = iprot.readBinary();
@ -805,10 +824,10 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
}
}
struct.setDataInListIsSet(true);
{
org.apache.thrift.protocol.TSet _set161 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.dataInSet = new HashSet<ByteBuffer>(2*_set161.size);
ByteBuffer _elem162;
{
org.apache.thrift.protocol.TSet _set161 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRING);
struct.dataInSet = new java.util.HashSet<java.nio.ByteBuffer>(2 * _set161.size);
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem162;
for (int _i163 = 0; _i163 < _set161.size; ++_i163)
{
_elem162 = iprot.readBinary();
@ -816,11 +835,11 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
}
}
struct.setDataInSetIsSet(true);
{
org.apache.thrift.protocol.TMap _map164 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.dataInMap = new HashMap<ByteBuffer,ByteBuffer>(2*_map164.size);
ByteBuffer _key165;
ByteBuffer _val166;
{
org.apache.thrift.protocol.TMap _map164 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING);
struct.dataInMap = new java.util.HashMap<java.nio.ByteBuffer, java.nio.ByteBuffer>(2 * _map164.size);
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _key165;
@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _val166;
for (int _i167 = 0; _i167 < _map164.size; ++_i167)
{
_key165 = iprot.readBinary();
@ -830,10 +849,10 @@ public class BinaryTest implements org.apache.thrift.TBase<BinaryTest, BinaryTes
}
struct.setDataInMapIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,9 +1,15 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.TEnum;
public enum Enums implements TEnum {
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public enum Enums implements org.apache.thrift.TEnum {
TEST1(0),
TEST2(1),
TEST3(2);
@ -17,6 +23,7 @@ public enum Enums implements TEnum {
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
@Override
public int getValue() {
return value;
}
@ -25,6 +32,7 @@ public enum Enums implements TEnum {
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static Enums findByValue(int value) {
switch (value) {
case 0:

View File

@ -1,33 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.io.Serializable, Cloneable, Comparable<Fail> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Fail");
private static final org.apache.thrift.protocol.TField REASONS_FIELD_DESC = new org.apache.thrift.protocol.TField("reasons", org.apache.thrift.protocol.TType.SET, (short)1);
private static final org.apache.thrift.protocol.TField REASONS_FIELD_DESC = new org.apache.thrift.protocol.TField("reasons", org.apache.thrift.protocol.TType.SET, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new FailStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new FailTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FailStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FailTupleSchemeFactory();
public Set<String> reasons; // optional
public @org.apache.thrift.annotation.Nullable java.util.Set<java.lang.String> reasons; // 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 {
REASONS((short)1, "reasons");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -35,6 +34,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
/**
* 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: // REASONS
@ -50,43 +50,46 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.REASONS};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.REASONS, new org.apache.thrift.meta_data.FieldMetaData("reasons", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Fail.class, metaDataMap);
}
@ -98,11 +101,12 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
*/
public Fail(Fail other) {
if (other.isSetReasons()) {
Set<String> __this__reasons = new HashSet<String>(other.reasons);
java.util.Set<java.lang.String> __this__reasons = new java.util.HashSet<java.lang.String>(other.reasons);
this.reasons = __this__reasons;
}
}
@Override
public Fail deepCopy() {
return new Fail(this);
}
@ -116,22 +120,24 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return (this.reasons == null) ? 0 : this.reasons.size();
}
public java.util.Iterator<String> getReasonsIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.lang.String> getReasonsIterator() {
return (this.reasons == null) ? null : this.reasons.iterator();
}
}
public void addToReasons(String elem) {
public void addToReasons(java.lang.String elem) {
if (this.reasons == null) {
this.reasons = new HashSet<String>();
this.reasons = new java.util.HashSet<java.lang.String>();
}
this.reasons.add(elem);
}
}
public Set<String> getReasons() {
@org.apache.thrift.annotation.Nullable
public java.util.Set<java.lang.String> getReasons() {
return this.reasons;
}
}
public Fail setReasons(Set<String> reasons) {
public Fail setReasons(@org.apache.thrift.annotation.Nullable java.util.Set<java.lang.String> reasons) {
this.reasons = reasons;
return this;
}
@ -151,45 +157,47 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case REASONS:
if (value == null) {
unsetReasons();
} else {
setReasons((Set<String>)value);
setReasons((java.util.Set<java.lang.String>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case REASONS:
return getReasons();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case REASONS:
return isSetReasons();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Fail)
return this.equals((Fail)that);
return false;
@ -198,6 +206,8 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
public boolean equals(Fail that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_reasons = true && this.isSetReasons();
boolean that_present_reasons = true && that.isSetReasons();
@ -230,7 +240,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetReasons()).compareTo(other.isSetReasons());
lastComparison = java.lang.Boolean.compare(isSetReasons(), other.isSetReasons());
if (lastComparison != 0) {
return lastComparison;
}
@ -243,6 +253,8 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -251,21 +263,23 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Fail(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Fail(");
boolean first = true;
if (isSetReasons()) {
@ -294,22 +308,24 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 FailStandardSchemeFactory implements SchemeFactory {
private static class FailStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FailStandardScheme getScheme() {
return new FailStandardScheme();
}
}
}
private static class FailStandardScheme extends StandardScheme<Fail> {
private static class FailStandardScheme extends org.apache.thrift.scheme.StandardScheme<Fail> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Fail struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -324,8 +340,8 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set176 = iprot.readSetBegin();
struct.reasons = new HashSet<String>(2*_set176.size);
String _elem177;
struct.reasons = new java.util.HashSet<java.lang.String>(2 * _set176.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem177;
for (int _i178 = 0; _i178 < _set176.size; ++_i178)
{
_elem177 = iprot.readString();
@ -347,8 +363,9 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Fail struct) throws org.apache.thrift.TException {
struct.validate();
@ -358,7 +375,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
oprot.writeFieldBegin(REASONS_FIELD_DESC);
{
oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.reasons.size()));
for (String _iter179 : struct.reasons)
for (java.lang.String _iter179 : struct.reasons)
{
oprot.writeString(_iter179);
}
@ -371,20 +388,21 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
oprot.writeStructEnd();
}
}
}
private static class FailTupleSchemeFactory implements SchemeFactory {
private static class FailTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FailTupleScheme getScheme() {
return new FailTupleScheme();
}
}
}
private static class FailTupleScheme extends TupleScheme<Fail> {
private static class FailTupleScheme extends org.apache.thrift.scheme.TupleScheme<Fail> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Fail struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetReasons()) {
optionals.set(0);
}
@ -392,7 +410,7 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
if (struct.isSetReasons()) {
{
oprot.writeI32(struct.reasons.size());
for (String _iter180 : struct.reasons)
for (java.lang.String _iter180 : struct.reasons)
{
oprot.writeString(_iter180);
}
@ -402,13 +420,13 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Fail struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TSet _set181 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.reasons = new HashSet<String>(2*_set181.size);
String _elem182;
{
org.apache.thrift.protocol.TSet _set181 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRING);
struct.reasons = new java.util.HashSet<java.lang.String>(2 * _set181.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem182;
for (int _i183 = 0; _i183 < _set181.size; ++_i183)
{
_elem182 = iprot.readString();
@ -418,10 +436,10 @@ public class Fail implements org.apache.thrift.TBase<Fail, Fail._Fields>, java.i
struct.setReasonsIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,33 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class FilterListObject implements org.apache.thrift.TBase<FilterListObject, FilterListObject._Fields>, java.io.Serializable, Cloneable, Comparable<FilterListObject> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FilterListObject");
private static final org.apache.thrift.protocol.TField STRINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("strings", org.apache.thrift.protocol.TType.LIST, (short)1);
private static final org.apache.thrift.protocol.TField STRINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("strings", org.apache.thrift.protocol.TType.LIST, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new FilterListObjectStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new FilterListObjectTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FilterListObjectStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FilterListObjectTupleSchemeFactory();
public List<String> strings; // required
public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> strings; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
STRINGS((short)1, "strings");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -35,6 +34,7 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
/**
* 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: // STRINGS
@ -50,42 +50,45 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.STRINGS, new org.apache.thrift.meta_data.FieldMetaData("strings", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FilterListObject.class, metaDataMap);
}
@ -93,7 +96,7 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
}
public FilterListObject(
List<String> strings)
java.util.List<java.lang.String> strings)
{
this();
this.strings = strings;
@ -104,11 +107,12 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
*/
public FilterListObject(FilterListObject other) {
if (other.isSetStrings()) {
List<String> __this__strings = new ArrayList<String>(other.strings);
java.util.List<java.lang.String> __this__strings = new java.util.ArrayList<java.lang.String>(other.strings);
this.strings = __this__strings;
}
}
@Override
public FilterListObject deepCopy() {
return new FilterListObject(this);
}
@ -122,22 +126,24 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
return (this.strings == null) ? 0 : this.strings.size();
}
public java.util.Iterator<String> getStringsIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.lang.String> getStringsIterator() {
return (this.strings == null) ? null : this.strings.iterator();
}
}
public void addToStrings(String elem) {
public void addToStrings(java.lang.String elem) {
if (this.strings == null) {
this.strings = new ArrayList<String>();
this.strings = new java.util.ArrayList<java.lang.String>();
}
this.strings.add(elem);
}
}
public List<String> getStrings() {
@org.apache.thrift.annotation.Nullable
public java.util.List<java.lang.String> getStrings() {
return this.strings;
}
}
public FilterListObject setStrings(List<String> strings) {
public FilterListObject setStrings(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> strings) {
this.strings = strings;
return this;
}
@ -157,45 +163,47 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case STRINGS:
if (value == null) {
unsetStrings();
} else {
setStrings((List<String>)value);
setStrings((java.util.List<java.lang.String>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case STRINGS:
return getStrings();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case STRINGS:
return isSetStrings();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof FilterListObject)
return this.equals((FilterListObject)that);
return false;
@ -204,6 +212,8 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
public boolean equals(FilterListObject that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_strings = true && this.isSetStrings();
boolean that_present_strings = true && that.isSetStrings();
@ -236,7 +246,7 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetStrings()).compareTo(other.isSetStrings());
lastComparison = java.lang.Boolean.compare(isSetStrings(), other.isSetStrings());
if (lastComparison != 0) {
return lastComparison;
}
@ -249,6 +259,8 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -257,21 +269,23 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("FilterListObject(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("FilterListObject(");
boolean first = true;
sb.append("strings:");
@ -298,22 +312,24 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 FilterListObjectStandardSchemeFactory implements SchemeFactory {
private static class FilterListObjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FilterListObjectStandardScheme getScheme() {
return new FilterListObjectStandardScheme();
}
}
}
private static class FilterListObjectStandardScheme extends StandardScheme<FilterListObject> {
private static class FilterListObjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<FilterListObject> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, FilterListObject struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -328,8 +344,8 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list184 = iprot.readListBegin();
struct.strings = new ArrayList<String>(_list184.size);
String _elem185;
struct.strings = new java.util.ArrayList<java.lang.String>(_list184.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem185;
for (int _i186 = 0; _i186 < _list184.size; ++_i186)
{
_elem185 = iprot.readString();
@ -351,8 +367,9 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, FilterListObject struct) throws org.apache.thrift.TException {
struct.validate();
@ -361,7 +378,7 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
oprot.writeFieldBegin(STRINGS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.strings.size()));
for (String _iter187 : struct.strings)
for (java.lang.String _iter187 : struct.strings)
{
oprot.writeString(_iter187);
}
@ -373,20 +390,21 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
oprot.writeStructEnd();
}
}
}
private static class FilterListObjectTupleSchemeFactory implements SchemeFactory {
private static class FilterListObjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FilterListObjectTupleScheme getScheme() {
return new FilterListObjectTupleScheme();
}
}
}
private static class FilterListObjectTupleScheme extends TupleScheme<FilterListObject> {
private static class FilterListObjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<FilterListObject> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FilterListObject struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetStrings()) {
optionals.set(0);
}
@ -394,7 +412,7 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
if (struct.isSetStrings()) {
{
oprot.writeI32(struct.strings.size());
for (String _iter188 : struct.strings)
for (java.lang.String _iter188 : struct.strings)
{
oprot.writeString(_iter188);
}
@ -404,13 +422,13 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, FilterListObject struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list189 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.strings = new ArrayList<String>(_list189.size);
String _elem190;
{
org.apache.thrift.protocol.TList _list189 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
struct.strings = new java.util.ArrayList<java.lang.String>(_list189.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem190;
for (int _i191 = 0; _i191 < _list189.size; ++_i191)
{
_elem190 = iprot.readString();
@ -420,10 +438,10 @@ public class FilterListObject implements org.apache.thrift.TBase<FilterListObjec
struct.setStringsIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,34 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject, FilterMapObject._Fields>, java.io.Serializable, Cloneable, Comparable<FilterMapObject> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FilterMapObject");
private static final org.apache.thrift.protocol.TField MAP1_FIELD_DESC = new org.apache.thrift.protocol.TField("map1", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField MAP1_FIELD_DESC = new org.apache.thrift.protocol.TField("map1", org.apache.thrift.protocol.TType.MAP, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new FilterMapObjectStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new FilterMapObjectTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FilterMapObjectStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FilterMapObjectTupleSchemeFactory();
public Map<String,Unknown> map1; // required
public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String, Unknown> map1; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
MAP1((short)1, "map1");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -36,6 +34,7 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
/**
* 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: // MAP1
@ -51,43 +50,46 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.MAP1, new org.apache.thrift.meta_data.FieldMetaData("map1", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Unknown.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FilterMapObject.class, metaDataMap);
}
@ -95,7 +97,7 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
}
public FilterMapObject(
Map<String,Unknown> map1)
java.util.Map<java.lang.String, Unknown> map1)
{
this();
this.map1 = map1;
@ -106,13 +108,13 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
*/
public FilterMapObject(FilterMapObject other) {
if (other.isSetMap1()) {
Map<String,Unknown> __this__map1 = new HashMap<String,Unknown>(other.map1.size());
for (Map.Entry<String, Unknown> other_element : other.map1.entrySet()) {
java.util.Map<java.lang.String, Unknown> __this__map1 = new java.util.HashMap<java.lang.String, Unknown>(other.map1.size());
for (java.util.Map.Entry<java.lang.String, Unknown> other_element : other.map1.entrySet()) {
String other_element_key = other_element.getKey();
java.lang.String other_element_key = other_element.getKey();
Unknown other_element_value = other_element.getValue();
String __this__map1_copy_key = other_element_key;
java.lang.String __this__map1_copy_key = other_element_key;
Unknown __this__map1_copy_value = new Unknown(other_element_value);
@ -122,6 +124,7 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
}
}
@Override
public FilterMapObject deepCopy() {
return new FilterMapObject(this);
}
@ -135,18 +138,19 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
return (this.map1 == null) ? 0 : this.map1.size();
}
public void putToMap1(String key, Unknown val) {
public void putToMap1(java.lang.String key, Unknown val) {
if (this.map1 == null) {
this.map1 = new HashMap<String,Unknown>();
this.map1 = new java.util.HashMap<java.lang.String, Unknown>();
}
this.map1.put(key, val);
}
}
public Map<String,Unknown> getMap1() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<java.lang.String, Unknown> getMap1() {
return this.map1;
}
}
public FilterMapObject setMap1(Map<String,Unknown> map1) {
public FilterMapObject setMap1(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String, Unknown> map1) {
this.map1 = map1;
return this;
}
@ -166,45 +170,47 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case MAP1:
if (value == null) {
unsetMap1();
} else {
setMap1((Map<String,Unknown>)value);
setMap1((java.util.Map<java.lang.String, Unknown>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case MAP1:
return getMap1();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case MAP1:
return isSetMap1();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof FilterMapObject)
return this.equals((FilterMapObject)that);
return false;
@ -213,6 +219,8 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
public boolean equals(FilterMapObject that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_map1 = true && this.isSetMap1();
boolean that_present_map1 = true && that.isSetMap1();
@ -245,7 +253,7 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetMap1()).compareTo(other.isSetMap1());
lastComparison = java.lang.Boolean.compare(isSetMap1(), other.isSetMap1());
if (lastComparison != 0) {
return lastComparison;
}
@ -258,6 +266,8 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -266,21 +276,23 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("FilterMapObject(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("FilterMapObject(");
boolean first = true;
sb.append("map1:");
@ -297,7 +309,7 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (map1 == null) {
throw new TProtocolException("Required field 'map1' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'map1' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -310,22 +322,24 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 FilterMapObjectStandardSchemeFactory implements SchemeFactory {
private static class FilterMapObjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FilterMapObjectStandardScheme getScheme() {
return new FilterMapObjectStandardScheme();
}
}
}
private static class FilterMapObjectStandardScheme extends StandardScheme<FilterMapObject> {
private static class FilterMapObjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<FilterMapObject> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, FilterMapObject struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -340,9 +354,9 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map192 = iprot.readMapBegin();
struct.map1 = new HashMap<String,Unknown>(2*_map192.size);
String _key193;
Unknown _val194;
struct.map1 = new java.util.HashMap<java.lang.String, Unknown>(2 * _map192.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key193;
@org.apache.thrift.annotation.Nullable Unknown _val194;
for (int _i195 = 0; _i195 < _map192.size; ++_i195)
{
_key193 = iprot.readString();
@ -366,8 +380,9 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, FilterMapObject struct) throws org.apache.thrift.TException {
struct.validate();
@ -376,7 +391,7 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
oprot.writeFieldBegin(MAP1_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.map1.size()));
for (Map.Entry<String, Unknown> _iter196 : struct.map1.entrySet())
for (java.util.Map.Entry<java.lang.String, Unknown> _iter196 : struct.map1.entrySet())
{
oprot.writeString(_iter196.getKey());
_iter196.getValue().write(oprot);
@ -389,22 +404,23 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
oprot.writeStructEnd();
}
}
}
private static class FilterMapObjectTupleSchemeFactory implements SchemeFactory {
private static class FilterMapObjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FilterMapObjectTupleScheme getScheme() {
return new FilterMapObjectTupleScheme();
}
}
}
private static class FilterMapObjectTupleScheme extends TupleScheme<FilterMapObject> {
private static class FilterMapObjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<FilterMapObject> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FilterMapObject struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
{
oprot.writeI32(struct.map1.size());
for (Map.Entry<String, Unknown> _iter197 : struct.map1.entrySet())
for (java.util.Map.Entry<java.lang.String, Unknown> _iter197 : struct.map1.entrySet())
{
oprot.writeString(_iter197.getKey());
_iter197.getValue().write(oprot);
@ -414,12 +430,12 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, FilterMapObject struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
{
org.apache.thrift.protocol.TMap _map198 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.map1 = new HashMap<String,Unknown>(2*_map198.size);
String _key199;
Unknown _val200;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
{
org.apache.thrift.protocol.TMap _map198 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT);
struct.map1 = new java.util.HashMap<java.lang.String, Unknown>(2 * _map198.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key199;
@org.apache.thrift.annotation.Nullable Unknown _val200;
for (int _i201 = 0; _i201 < _map198.size; ++_i201)
{
_key199 = iprot.readString();
@ -430,10 +446,10 @@ public class FilterMapObject implements org.apache.thrift.TBase<FilterMapObject,
}
struct.setMap1IsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,29 +1,27 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class FilterObject implements org.apache.thrift.TBase<FilterObject, FilterObject._Fields>, java.io.Serializable, Cloneable, Comparable<FilterObject> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FilterObject");
private static final org.apache.thrift.protocol.TField SNAME1_FIELD_DESC = new org.apache.thrift.protocol.TField("sname1", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField UNAME1_FIELD_DESC = new org.apache.thrift.protocol.TField("uname1", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField SNAME2_FIELD_DESC = new org.apache.thrift.protocol.TField("sname2", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField SNAME2_FIELD_DESC = new org.apache.thrift.protocol.TField("sname2", org.apache.thrift.protocol.TType.STRING, (short) 3);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new FilterObjectStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new FilterObjectTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FilterObjectStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FilterObjectTupleSchemeFactory();
public String sname1; // required
public FilterUnion uname1; // required
public String sname2; // required
public @org.apache.thrift.annotation.Nullable java.lang.String sname1; // required
public @org.apache.thrift.annotation.Nullable FilterUnion uname1; // required
public @org.apache.thrift.annotation.Nullable java.lang.String sname2; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -31,10 +29,10 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
UNAME1((short)2, "uname1"),
SNAME2((short)3, "sname2");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -42,6 +40,7 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
/**
* 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: // SNAME1
@ -61,45 +60,48 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.SNAME1, new org.apache.thrift.meta_data.FieldMetaData("sname1", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.UNAME1, new org.apache.thrift.meta_data.FieldMetaData("uname1", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FilterUnion.class)));
tmpMap.put(_Fields.SNAME2, new org.apache.thrift.meta_data.FieldMetaData("sname2", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FilterObject.class, metaDataMap);
}
@ -107,9 +109,9 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
}
public FilterObject(
String sname1,
java.lang.String sname1,
FilterUnion uname1,
String sname2)
java.lang.String sname2)
{
this();
this.sname1 = sname1;
@ -132,6 +134,7 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
}
}
@Override
public FilterObject deepCopy() {
return new FilterObject(this);
}
@ -143,11 +146,12 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
this.sname2 = null;
}
public String getSname1() {
@org.apache.thrift.annotation.Nullable
public java.lang.String getSname1() {
return this.sname1;
}
}
public FilterObject setSname1(String sname1) {
public FilterObject setSname1(@org.apache.thrift.annotation.Nullable java.lang.String sname1) {
this.sname1 = sname1;
return this;
}
@ -167,11 +171,12 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
}
}
@org.apache.thrift.annotation.Nullable
public FilterUnion getUname1() {
return this.uname1;
}
}
public FilterObject setUname1(FilterUnion uname1) {
public FilterObject setUname1(@org.apache.thrift.annotation.Nullable FilterUnion uname1) {
this.uname1 = uname1;
return this;
}
@ -191,11 +196,12 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
}
}
public String getSname2() {
@org.apache.thrift.annotation.Nullable
public java.lang.String getSname2() {
return this.sname2;
}
}
public FilterObject setSname2(String sname2) {
public FilterObject setSname2(@org.apache.thrift.annotation.Nullable java.lang.String sname2) {
this.sname2 = sname2;
return this;
}
@ -215,13 +221,14 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SNAME1:
if (value == null) {
unsetSname1();
} else {
setSname1((String)value);
setSname1((java.lang.String) value);
}
break;
@ -237,14 +244,16 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
if (value == null) {
unsetSname2();
} else {
setSname2((String)value);
setSname2((java.lang.String) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SNAME1:
return getSname1();
@ -256,13 +265,14 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
return getSname2();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -273,13 +283,11 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
case SNAME2:
return isSetSname2();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof FilterObject)
return this.equals((FilterObject)that);
return false;
@ -288,6 +296,8 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
public boolean equals(FilterObject that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_sname1 = true && this.isSetSname1();
boolean that_present_sname1 = true && that.isSetSname1();
@ -346,7 +356,7 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSname1()).compareTo(other.isSetSname1());
lastComparison = java.lang.Boolean.compare(isSetSname1(), other.isSetSname1());
if (lastComparison != 0) {
return lastComparison;
}
@ -356,7 +366,7 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUname1()).compareTo(other.isSetUname1());
lastComparison = java.lang.Boolean.compare(isSetUname1(), other.isSetUname1());
if (lastComparison != 0) {
return lastComparison;
}
@ -366,7 +376,7 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSname2()).compareTo(other.isSetSname2());
lastComparison = java.lang.Boolean.compare(isSetSname2(), other.isSetSname2());
if (lastComparison != 0) {
return lastComparison;
}
@ -379,6 +389,8 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -387,21 +399,23 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("FilterObject(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("FilterObject(");
boolean first = true;
sb.append("sname1:");
@ -434,10 +448,10 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (sname1 == null) {
throw new TProtocolException("Required field 'sname1' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sname1' was not present! Struct: " + toString());
}
if (sname2 == null) {
throw new TProtocolException("Required field 'sname2' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'sname2' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -450,22 +464,24 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 FilterObjectStandardSchemeFactory implements SchemeFactory {
private static class FilterObjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FilterObjectStandardScheme getScheme() {
return new FilterObjectStandardScheme();
}
}
}
private static class FilterObjectStandardScheme extends StandardScheme<FilterObject> {
private static class FilterObjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<FilterObject> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, FilterObject struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -510,8 +526,9 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, FilterObject struct) throws org.apache.thrift.TException {
struct.validate();
@ -535,22 +552,23 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
oprot.writeStructEnd();
}
}
}
private static class FilterObjectTupleSchemeFactory implements SchemeFactory {
private static class FilterObjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public FilterObjectTupleScheme getScheme() {
return new FilterObjectTupleScheme();
}
}
}
private static class FilterObjectTupleScheme extends TupleScheme<FilterObject> {
private static class FilterObjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<FilterObject> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FilterObject struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.sname1);
oprot.writeString(struct.sname2);
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetUname1()) {
optionals.set(0);
}
@ -562,22 +580,22 @@ public class FilterObject implements org.apache.thrift.TBase<FilterObject, Filte
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, FilterObject struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.sname1 = iprot.readString();
struct.setSname1IsSet(true);
struct.sname2 = iprot.readString();
struct.setSname2IsSet(true);
BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.uname1 = new FilterUnion();
struct.uname1.read(iprot);
struct.setUname1IsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,9 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import java.util.*;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUnion._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FilterUnion");
private static final org.apache.thrift.protocol.TField LIST_OBJECT_1_FIELD_DESC = new org.apache.thrift.protocol.TField("list_object_1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@ -12,10 +17,10 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
LIST_OBJECT_1((short)1, "list_object_1");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -23,6 +28,7 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
/**
* 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: // LIST_OBJECT_1
@ -38,40 +44,43 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.LIST_OBJECT_1, new org.apache.thrift.meta_data.FieldMetaData("list_object_1", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FilterListObject.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FilterUnion.class, metaDataMap);
}
@ -79,13 +88,15 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
super();
}
public FilterUnion(_Fields setField, Object value) {
public FilterUnion(_Fields setField, java.lang.Object value) {
super(setField, value);
}
public FilterUnion(FilterUnion other) {
super(other);
}
@Override
public FilterUnion deepCopy() {
return new FilterUnion(this);
}
@ -98,20 +109,20 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
@Override
protected void checkType(_Fields setField, Object value) throws ClassCastException {
protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
switch (setField) {
case LIST_OBJECT_1:
if (value instanceof FilterListObject) {
break;
}
throw new ClassCastException("Was expecting value of type FilterListObject for field 'list_object_1', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type FilterListObject for field 'list_object_1', but got " + value.getClass().getSimpleName());
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(field.id);
if (setField != null) {
switch (setField) {
@ -126,7 +137,7 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
return null;
}
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
@ -142,12 +153,12 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
list_object_1.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(fieldID);
if (setField != null) {
switch (setField) {
@ -157,10 +168,10 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
list_object_1.read(iprot);
return list_object_1;
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new TProtocolException("Couldn't find a field with field id " + fieldID);
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@ -172,7 +183,7 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
list_object_1.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@ -182,7 +193,7 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
case LIST_OBJECT_1:
return LIST_OBJECT_1_FIELD_DESC;
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@ -200,10 +211,12 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -213,14 +226,13 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
if (getSetField() == _Fields.LIST_OBJECT_1) {
return (FilterListObject)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'list_object_1' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'list_object_1' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setListObject1(FilterListObject value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.LIST_OBJECT_1;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.LIST_OBJECT_1");
}
public boolean isSetListObject1() {
@ -228,7 +240,7 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
}
public boolean equals(Object other) {
public boolean equals(java.lang.Object other) {
if (other instanceof FilterUnion) {
return equals((FilterUnion)other);
} else {
@ -252,12 +264,12 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {
list.add(setField.getThriftFieldId());
Object value = getFieldValue();
java.lang.Object value = getFieldValue();
if (value instanceof org.apache.thrift.TEnum) {
list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
} else {
@ -275,7 +287,7 @@ public class FilterUnion extends org.apache.thrift.TUnion<FilterUnion, FilterUni
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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) {

View File

@ -1,30 +1,27 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, HandlerTest._Fields>, java.io.Serializable, Cloneable, Comparable<HandlerTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HandlerTest");
private static final org.apache.thrift.protocol.TField ONE_FIELD_DESC = new org.apache.thrift.protocol.TField("one", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField TWO_FIELD_DESC = new org.apache.thrift.protocol.TField("two", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField THREE_FIELD_DESC = new org.apache.thrift.protocol.TField("three", org.apache.thrift.protocol.TType.LIST, (short)3);
private static final org.apache.thrift.protocol.TField THREE_FIELD_DESC = new org.apache.thrift.protocol.TField("three", org.apache.thrift.protocol.TType.LIST, (short) 3);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new HandlerTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new HandlerTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new HandlerTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new HandlerTestTupleSchemeFactory();
public String one; // required
public @org.apache.thrift.annotation.Nullable java.lang.String one; // required
public int two; // required
public List<String> three; // required
public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> three; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@ -32,10 +29,10 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
TWO((short)2, "two"),
THREE((short)3, "three");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -43,6 +40,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
/**
* 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: // ONE
@ -62,30 +60,33 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -93,9 +94,9 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
// isset id assignments
private static final int __TWO_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.ONE, new org.apache.thrift.meta_data.FieldMetaData("one", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TWO, new org.apache.thrift.meta_data.FieldMetaData("two", org.apache.thrift.TFieldRequirementType.REQUIRED,
@ -103,7 +104,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
tmpMap.put(_Fields.THREE, new org.apache.thrift.meta_data.FieldMetaData("three", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HandlerTest.class, metaDataMap);
}
@ -111,9 +112,9 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
}
public HandlerTest(
String one,
java.lang.String one,
int two,
List<String> three)
java.util.List<java.lang.String> three)
{
this();
this.one = one;
@ -132,11 +133,12 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
}
this.two = other.two;
if (other.isSetThree()) {
List<String> __this__three = new ArrayList<String>(other.three);
java.util.List<java.lang.String> __this__three = new java.util.ArrayList<java.lang.String>(other.three);
this.three = __this__three;
}
}
@Override
public HandlerTest deepCopy() {
return new HandlerTest(this);
}
@ -149,11 +151,12 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
this.three = null;
}
public String getOne() {
@org.apache.thrift.annotation.Nullable
public java.lang.String getOne() {
return this.one;
}
}
public HandlerTest setOne(String one) {
public HandlerTest setOne(@org.apache.thrift.annotation.Nullable java.lang.String one) {
this.one = one;
return this;
}
@ -184,38 +187,40 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
}
public void unsetTwo() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TWO_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TWO_ISSET_ID);
}
/** Returns true if field two is set (has been assigned a value) and false otherwise */
public boolean isSetTwo() {
return EncodingUtils.testBit(__isset_bitfield, __TWO_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TWO_ISSET_ID);
}
public void setTwoIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TWO_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TWO_ISSET_ID, value);
}
public int getThreeSize() {
return (this.three == null) ? 0 : this.three.size();
}
public java.util.Iterator<String> getThreeIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.lang.String> getThreeIterator() {
return (this.three == null) ? null : this.three.iterator();
}
}
public void addToThree(String elem) {
public void addToThree(java.lang.String elem) {
if (this.three == null) {
this.three = new ArrayList<String>();
this.three = new java.util.ArrayList<java.lang.String>();
}
this.three.add(elem);
}
}
public List<String> getThree() {
@org.apache.thrift.annotation.Nullable
public java.util.List<java.lang.String> getThree() {
return this.three;
}
}
public HandlerTest setThree(List<String> three) {
public HandlerTest setThree(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> three) {
this.three = three;
return this;
}
@ -235,13 +240,14 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ONE:
if (value == null) {
unsetOne();
} else {
setOne((String)value);
setOne((java.lang.String) value);
}
break;
@ -249,7 +255,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
if (value == null) {
unsetTwo();
} else {
setTwo((Integer)value);
setTwo((java.lang.Integer) value);
}
break;
@ -257,14 +263,16 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
if (value == null) {
unsetThree();
} else {
setThree((List<String>)value);
setThree((java.util.List<java.lang.String>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ONE:
return getOne();
@ -276,13 +284,14 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
return getThree();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -293,13 +302,11 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
case THREE:
return isSetThree();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof HandlerTest)
return this.equals((HandlerTest)that);
return false;
@ -308,6 +315,8 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
public boolean equals(HandlerTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_one = true && this.isSetOne();
boolean that_present_one = true && that.isSetOne();
@ -364,7 +373,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetOne()).compareTo(other.isSetOne());
lastComparison = java.lang.Boolean.compare(isSetOne(), other.isSetOne());
if (lastComparison != 0) {
return lastComparison;
}
@ -374,7 +383,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTwo()).compareTo(other.isSetTwo());
lastComparison = java.lang.Boolean.compare(isSetTwo(), other.isSetTwo());
if (lastComparison != 0) {
return lastComparison;
}
@ -384,7 +393,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetThree()).compareTo(other.isSetThree());
lastComparison = java.lang.Boolean.compare(isSetThree(), other.isSetThree());
if (lastComparison != 0) {
return lastComparison;
}
@ -397,6 +406,8 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -405,21 +416,23 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("HandlerTest(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("HandlerTest(");
boolean first = true;
sb.append("one:");
@ -448,11 +461,11 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (one == null) {
throw new TProtocolException("Required field 'one' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'one' was not present! Struct: " + toString());
}
// alas, we cannot check 'two' because it's a primitive and you chose the non-beans generator.
if (three == null) {
throw new TProtocolException("Required field 'three' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'three' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -465,7 +478,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -473,23 +486,25 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
private static class HandlerTestStandardSchemeFactory implements SchemeFactory {
private static class HandlerTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public HandlerTestStandardScheme getScheme() {
return new HandlerTestStandardScheme();
}
}
}
private static class HandlerTestStandardScheme extends StandardScheme<HandlerTest> {
private static class HandlerTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<HandlerTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, HandlerTest 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) {
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
@ -497,7 +512,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.one = iprot.readString();
struct.setOneIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -505,7 +520,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.two = iprot.readI32();
struct.setTwoIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -513,8 +528,8 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
struct.three = new ArrayList<String>(_list134.size);
String _elem135;
struct.three = new java.util.ArrayList<java.lang.String>(_list134.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem135;
for (int _i136 = 0; _i136 < _list134.size; ++_i136)
{
_elem135 = iprot.readString();
@ -523,7 +538,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
iprot.readListEnd();
}
struct.setThreeIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -536,11 +551,12 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetTwo()) {
throw new TProtocolException("Required field 'two' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'two' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, HandlerTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -557,7 +573,7 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
oprot.writeFieldBegin(THREE_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.three.size()));
for (String _iter137 : struct.three)
for (java.lang.String _iter137 : struct.three)
{
oprot.writeString(_iter137);
}
@ -569,24 +585,25 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
oprot.writeStructEnd();
}
}
}
private static class HandlerTestTupleSchemeFactory implements SchemeFactory {
private static class HandlerTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public HandlerTestTupleScheme getScheme() {
return new HandlerTestTupleScheme();
}
}
}
private static class HandlerTestTupleScheme extends TupleScheme<HandlerTest> {
private static class HandlerTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<HandlerTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, HandlerTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.one);
oprot.writeI32(struct.two);
{
oprot.writeI32(struct.three.size());
for (String _iter138 : struct.three)
for (java.lang.String _iter138 : struct.three)
{
oprot.writeString(_iter138);
}
@ -595,15 +612,15 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, HandlerTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.one = iprot.readString();
struct.setOneIsSet(true);
struct.two = iprot.readI32();
struct.setTwoIsSet(true);
{
org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.three = new ArrayList<String>(_list139.size);
String _elem140;
{
org.apache.thrift.protocol.TList _list139 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
struct.three = new java.util.ArrayList<java.lang.String>(_list139.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem140;
for (int _i141 = 0; _i141 < _list139.size; ++_i141)
{
_elem140 = iprot.readString();
@ -612,10 +629,10 @@ public class HandlerTest implements org.apache.thrift.TBase<HandlerTest, Handler
}
struct.setThreeIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,27 +1,24 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.Serializable, Cloneable, Comparable<Ids> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Ids");
private static final org.apache.thrift.protocol.TField MICRO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("micro_id", org.apache.thrift.protocol.TType.BYTE, (short)1);
private static final org.apache.thrift.protocol.TField MINI_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("mini_id", org.apache.thrift.protocol.TType.I16, (short)2);
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField BIG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("big_id", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField BIG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("big_id", org.apache.thrift.protocol.TType.I64, (short) 4);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new IdsStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new IdsTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IdsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IdsTupleSchemeFactory();
public byte micro_id; // required
public short mini_id; // required
@ -35,10 +32,10 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
ID((short)3, "id"),
BIG_ID((short)4, "big_id");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -46,6 +43,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
/**
* 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: // MICRO_ID
@ -67,30 +65,33 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -101,9 +102,9 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
private static final int __ID_ISSET_ID = 2;
private static final int __BIG_ID_ISSET_ID = 3;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.MICRO_ID, new org.apache.thrift.meta_data.FieldMetaData("micro_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.MINI_ID, new org.apache.thrift.meta_data.FieldMetaData("mini_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
@ -112,7 +113,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.BIG_ID, new org.apache.thrift.meta_data.FieldMetaData("big_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Ids.class, metaDataMap);
}
@ -147,6 +148,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
this.big_id = other.big_id;
}
@Override
public Ids deepCopy() {
return new Ids(this);
}
@ -174,16 +176,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetMicroId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
}
/** Returns true if field micro_id is set (has been assigned a value) and false otherwise */
public boolean isSetMicroId() {
return EncodingUtils.testBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MICRO_ID_ISSET_ID);
}
public void setMicroIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MICRO_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MICRO_ID_ISSET_ID, value);
}
public short getMiniId() {
@ -197,16 +199,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetMiniId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MINI_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MINI_ID_ISSET_ID);
}
/** Returns true if field mini_id is set (has been assigned a value) and false otherwise */
public boolean isSetMiniId() {
return EncodingUtils.testBit(__isset_bitfield, __MINI_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MINI_ID_ISSET_ID);
}
public void setMiniIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MINI_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MINI_ID_ISSET_ID, value);
}
public int getId() {
@ -220,16 +222,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
}
public void setIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
}
public long getBigId() {
@ -243,25 +245,26 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
public void unsetBigId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BIG_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BIG_ID_ISSET_ID);
}
/** Returns true if field big_id is set (has been assigned a value) and false otherwise */
public boolean isSetBigId() {
return EncodingUtils.testBit(__isset_bitfield, __BIG_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BIG_ID_ISSET_ID);
}
public void setBigIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BIG_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BIG_ID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case MICRO_ID:
if (value == null) {
unsetMicroId();
} else {
setMicroId((Byte)value);
setMicroId((java.lang.Byte) value);
}
break;
@ -269,7 +272,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
if (value == null) {
unsetMiniId();
} else {
setMiniId((Short)value);
setMiniId((java.lang.Short) value);
}
break;
@ -277,7 +280,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
if (value == null) {
unsetId();
} else {
setId((Integer)value);
setId((java.lang.Integer) value);
}
break;
@ -285,14 +288,16 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
if (value == null) {
unsetBigId();
} else {
setBigId((Long)value);
setBigId((java.lang.Long) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case MICRO_ID:
return getMicroId();
@ -307,13 +312,14 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return getBigId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -326,13 +332,11 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
case BIG_ID:
return isSetBigId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Ids)
return this.equals((Ids)that);
return false;
@ -341,6 +345,8 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
public boolean equals(Ids that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_micro_id = true;
boolean that_present_micro_id = true;
@ -404,7 +410,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetMicroId()).compareTo(other.isSetMicroId());
lastComparison = java.lang.Boolean.compare(isSetMicroId(), other.isSetMicroId());
if (lastComparison != 0) {
return lastComparison;
}
@ -414,7 +420,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetMiniId()).compareTo(other.isSetMiniId());
lastComparison = java.lang.Boolean.compare(isSetMiniId(), other.isSetMiniId());
if (lastComparison != 0) {
return lastComparison;
}
@ -424,7 +430,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
@ -434,7 +440,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBigId()).compareTo(other.isSetBigId());
lastComparison = java.lang.Boolean.compare(isSetBigId(), other.isSetBigId());
if (lastComparison != 0) {
return lastComparison;
}
@ -447,6 +453,8 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -455,21 +463,23 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Ids(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Ids(");
boolean first = true;
sb.append("micro_id:");
@ -508,7 +518,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -516,16 +526,18 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
private static class IdsStandardSchemeFactory implements SchemeFactory {
private static class IdsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IdsStandardScheme getScheme() {
return new IdsStandardScheme();
}
}
}
private static class IdsStandardScheme extends StandardScheme<Ids> {
private static class IdsStandardScheme extends org.apache.thrift.scheme.StandardScheme<Ids> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Ids struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -577,20 +589,21 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetMicroId()) {
throw new TProtocolException("Required field 'micro_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'micro_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetMiniId()) {
throw new TProtocolException("Required field 'mini_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'mini_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetId()) {
throw new TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetBigId()) {
throw new TProtocolException("Required field 'big_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'big_id' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Ids struct) throws org.apache.thrift.TException {
struct.validate();
@ -611,19 +624,20 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
oprot.writeStructEnd();
}
}
}
private static class IdsTupleSchemeFactory implements SchemeFactory {
private static class IdsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public IdsTupleScheme getScheme() {
return new IdsTupleScheme();
}
}
}
private static class IdsTupleScheme extends TupleScheme<Ids> {
private static class IdsTupleScheme extends org.apache.thrift.scheme.TupleScheme<Ids> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Ids struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeByte(struct.micro_id);
oprot.writeI16(struct.mini_id);
oprot.writeI32(struct.id);
@ -632,7 +646,7 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Ids struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.micro_id = iprot.readByte();
struct.setMicroIdIsSet(true);
struct.mini_id = iprot.readI16();
@ -642,10 +656,10 @@ public class Ids implements org.apache.thrift.TBase<Ids, Ids._Fields>, java.io.S
struct.big_id = iprot.readI64();
struct.setBigIdIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,27 +1,24 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.io.Serializable, Cloneable, Comparable<Ids2> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Ids2");
private static final org.apache.thrift.protocol.TField ANOTHER_MICRO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_micro_id", org.apache.thrift.protocol.TType.BYTE, (short)1);
private static final org.apache.thrift.protocol.TField ANOTHER_MINI_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_mini_id", org.apache.thrift.protocol.TType.I16, (short)2);
private static final org.apache.thrift.protocol.TField ANOTHER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_id", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField ANOTHER_BIG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_big_id", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField ANOTHER_BIG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_big_id", org.apache.thrift.protocol.TType.I64, (short) 4);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new Ids2StandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new Ids2TupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new Ids2StandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new Ids2TupleSchemeFactory();
public byte another_micro_id; // required
public short another_mini_id; // required
@ -35,10 +32,10 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
ANOTHER_ID((short)3, "another_id"),
ANOTHER_BIG_ID((short)4, "another_big_id");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -46,6 +43,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
/**
* 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: // ANOTHER_MICRO_ID
@ -67,30 +65,33 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -101,9 +102,9 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
private static final int __ANOTHER_ID_ISSET_ID = 2;
private static final int __ANOTHER_BIG_ID_ISSET_ID = 3;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.ANOTHER_MICRO_ID, new org.apache.thrift.meta_data.FieldMetaData("another_micro_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.ANOTHER_MINI_ID, new org.apache.thrift.meta_data.FieldMetaData("another_mini_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
@ -112,7 +113,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.ANOTHER_BIG_ID, new org.apache.thrift.meta_data.FieldMetaData("another_big_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Ids2.class, metaDataMap);
}
@ -147,6 +148,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
this.another_big_id = other.another_big_id;
}
@Override
public Ids2 deepCopy() {
return new Ids2(this);
}
@ -174,16 +176,16 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
}
public void unsetAnotherMicroId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
}
/** Returns true if field another_micro_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherMicroId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
}
public void setAnotherMicroIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID, value);
}
public short getAnotherMiniId() {
@ -197,16 +199,16 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
}
public void unsetAnotherMiniId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
}
/** Returns true if field another_mini_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherMiniId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
}
public void setAnotherMiniIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID, value);
}
public int getAnotherId() {
@ -220,16 +222,16 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
}
public void unsetAnotherId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
}
/** Returns true if field another_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
}
public void setAnotherIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID, value);
}
public long getAnotherBigId() {
@ -243,25 +245,26 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
}
public void unsetAnotherBigId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
}
/** Returns true if field another_big_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherBigId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
}
public void setAnotherBigIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ANOTHER_MICRO_ID:
if (value == null) {
unsetAnotherMicroId();
} else {
setAnotherMicroId((Byte)value);
setAnotherMicroId((java.lang.Byte) value);
}
break;
@ -269,7 +272,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
if (value == null) {
unsetAnotherMiniId();
} else {
setAnotherMiniId((Short)value);
setAnotherMiniId((java.lang.Short) value);
}
break;
@ -277,7 +280,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
if (value == null) {
unsetAnotherId();
} else {
setAnotherId((Integer)value);
setAnotherId((java.lang.Integer) value);
}
break;
@ -285,14 +288,16 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
if (value == null) {
unsetAnotherBigId();
} else {
setAnotherBigId((Long)value);
setAnotherBigId((java.lang.Long) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ANOTHER_MICRO_ID:
return getAnotherMicroId();
@ -307,13 +312,14 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
return getAnotherBigId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -326,13 +332,11 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
case ANOTHER_BIG_ID:
return isSetAnotherBigId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Ids2)
return this.equals((Ids2)that);
return false;
@ -341,6 +345,8 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
public boolean equals(Ids2 that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_another_micro_id = true;
boolean that_present_another_micro_id = true;
@ -404,7 +410,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetAnotherMicroId()).compareTo(other.isSetAnotherMicroId());
lastComparison = java.lang.Boolean.compare(isSetAnotherMicroId(), other.isSetAnotherMicroId());
if (lastComparison != 0) {
return lastComparison;
}
@ -414,7 +420,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAnotherMiniId()).compareTo(other.isSetAnotherMiniId());
lastComparison = java.lang.Boolean.compare(isSetAnotherMiniId(), other.isSetAnotherMiniId());
if (lastComparison != 0) {
return lastComparison;
}
@ -424,7 +430,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAnotherId()).compareTo(other.isSetAnotherId());
lastComparison = java.lang.Boolean.compare(isSetAnotherId(), other.isSetAnotherId());
if (lastComparison != 0) {
return lastComparison;
}
@ -434,7 +440,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAnotherBigId()).compareTo(other.isSetAnotherBigId());
lastComparison = java.lang.Boolean.compare(isSetAnotherBigId(), other.isSetAnotherBigId());
if (lastComparison != 0) {
return lastComparison;
}
@ -447,6 +453,8 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -455,21 +463,23 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Ids2(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Ids2(");
boolean first = true;
sb.append("another_micro_id:");
@ -508,7 +518,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -516,16 +526,18 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
private static class Ids2StandardSchemeFactory implements SchemeFactory {
private static class Ids2StandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public Ids2StandardScheme getScheme() {
return new Ids2StandardScheme();
}
}
}
private static class Ids2StandardScheme extends StandardScheme<Ids2> {
private static class Ids2StandardScheme extends org.apache.thrift.scheme.StandardScheme<Ids2> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Ids2 struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -577,20 +589,21 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetAnotherMicroId()) {
throw new TProtocolException("Required field 'another_micro_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_micro_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAnotherMiniId()) {
throw new TProtocolException("Required field 'another_mini_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_mini_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAnotherId()) {
throw new TProtocolException("Required field 'another_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAnotherBigId()) {
throw new TProtocolException("Required field 'another_big_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_big_id' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Ids2 struct) throws org.apache.thrift.TException {
struct.validate();
@ -611,19 +624,20 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
oprot.writeStructEnd();
}
}
}
private static class Ids2TupleSchemeFactory implements SchemeFactory {
private static class Ids2TupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public Ids2TupleScheme getScheme() {
return new Ids2TupleScheme();
}
}
}
private static class Ids2TupleScheme extends TupleScheme<Ids2> {
private static class Ids2TupleScheme extends org.apache.thrift.scheme.TupleScheme<Ids2> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Ids2 struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeByte(struct.another_micro_id);
oprot.writeI16(struct.another_mini_id);
oprot.writeI32(struct.another_id);
@ -632,7 +646,7 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Ids2 struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.another_micro_id = iprot.readByte();
struct.setAnotherMicroIdIsSet(true);
struct.another_mini_id = iprot.readI16();
@ -642,10 +656,10 @@ public class Ids2 implements org.apache.thrift.TBase<Ids2, Ids2._Fields>, java.i
struct.another_big_id = iprot.readI64();
struct.setAnotherBigIdIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,27 +1,24 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.io.Serializable, Cloneable, Comparable<Ids3> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Ids3");
private static final org.apache.thrift.protocol.TField ANOTHER_MICRO_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_micro_id", org.apache.thrift.protocol.TType.BYTE, (short)4);
private static final org.apache.thrift.protocol.TField ANOTHER_MINI_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_mini_id", org.apache.thrift.protocol.TType.I16, (short)3);
private static final org.apache.thrift.protocol.TField ANOTHER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_id", org.apache.thrift.protocol.TType.I32, (short)2);
private static final org.apache.thrift.protocol.TField ANOTHER_BIG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_big_id", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField ANOTHER_BIG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("another_big_id", org.apache.thrift.protocol.TType.I64, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new Ids3StandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new Ids3TupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new Ids3StandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new Ids3TupleSchemeFactory();
public byte another_micro_id; // required
public short another_mini_id; // required
@ -35,10 +32,10 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
ANOTHER_ID((short)2, "another_id"),
ANOTHER_BIG_ID((short)1, "another_big_id");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -46,6 +43,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
/**
* 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 4: // ANOTHER_MICRO_ID
@ -67,30 +65,33 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
@ -101,9 +102,9 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
private static final int __ANOTHER_ID_ISSET_ID = 2;
private static final int __ANOTHER_BIG_ID_ISSET_ID = 3;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.ANOTHER_MICRO_ID, new org.apache.thrift.meta_data.FieldMetaData("another_micro_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.ANOTHER_MINI_ID, new org.apache.thrift.meta_data.FieldMetaData("another_mini_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
@ -112,7 +113,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.ANOTHER_BIG_ID, new org.apache.thrift.meta_data.FieldMetaData("another_big_id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Ids3.class, metaDataMap);
}
@ -147,6 +148,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
this.another_big_id = other.another_big_id;
}
@Override
public Ids3 deepCopy() {
return new Ids3(this);
}
@ -174,16 +176,16 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
}
public void unsetAnotherMicroId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
}
/** Returns true if field another_micro_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherMicroId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID);
}
public void setAnotherMicroIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MICRO_ID_ISSET_ID, value);
}
public short getAnotherMiniId() {
@ -197,16 +199,16 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
}
public void unsetAnotherMiniId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
}
/** Returns true if field another_mini_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherMiniId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID);
}
public void setAnotherMiniIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_MINI_ID_ISSET_ID, value);
}
public int getAnotherId() {
@ -220,16 +222,16 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
}
public void unsetAnotherId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
}
/** Returns true if field another_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID);
}
public void setAnotherIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_ID_ISSET_ID, value);
}
public long getAnotherBigId() {
@ -243,25 +245,26 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
}
public void unsetAnotherBigId() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
}
/** Returns true if field another_big_id is set (has been assigned a value) and false otherwise */
public boolean isSetAnotherBigId() {
return EncodingUtils.testBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID);
}
public void setAnotherBigIdIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID, value);
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ANOTHER_BIG_ID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ANOTHER_MICRO_ID:
if (value == null) {
unsetAnotherMicroId();
} else {
setAnotherMicroId((Byte)value);
setAnotherMicroId((java.lang.Byte) value);
}
break;
@ -269,7 +272,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
if (value == null) {
unsetAnotherMiniId();
} else {
setAnotherMiniId((Short)value);
setAnotherMiniId((java.lang.Short) value);
}
break;
@ -277,7 +280,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
if (value == null) {
unsetAnotherId();
} else {
setAnotherId((Integer)value);
setAnotherId((java.lang.Integer) value);
}
break;
@ -285,14 +288,16 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
if (value == null) {
unsetAnotherBigId();
} else {
setAnotherBigId((Long)value);
setAnotherBigId((java.lang.Long) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ANOTHER_MICRO_ID:
return getAnotherMicroId();
@ -307,13 +312,14 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
return getAnotherBigId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -326,13 +332,11 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
case ANOTHER_BIG_ID:
return isSetAnotherBigId();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Ids3)
return this.equals((Ids3)that);
return false;
@ -341,6 +345,8 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
public boolean equals(Ids3 that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_another_micro_id = true;
boolean that_present_another_micro_id = true;
@ -404,7 +410,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetAnotherMicroId()).compareTo(other.isSetAnotherMicroId());
lastComparison = java.lang.Boolean.compare(isSetAnotherMicroId(), other.isSetAnotherMicroId());
if (lastComparison != 0) {
return lastComparison;
}
@ -414,7 +420,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAnotherMiniId()).compareTo(other.isSetAnotherMiniId());
lastComparison = java.lang.Boolean.compare(isSetAnotherMiniId(), other.isSetAnotherMiniId());
if (lastComparison != 0) {
return lastComparison;
}
@ -424,7 +430,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAnotherId()).compareTo(other.isSetAnotherId());
lastComparison = java.lang.Boolean.compare(isSetAnotherId(), other.isSetAnotherId());
if (lastComparison != 0) {
return lastComparison;
}
@ -434,7 +440,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAnotherBigId()).compareTo(other.isSetAnotherBigId());
lastComparison = java.lang.Boolean.compare(isSetAnotherBigId(), other.isSetAnotherBigId());
if (lastComparison != 0) {
return lastComparison;
}
@ -447,6 +453,8 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -455,21 +463,23 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Ids3(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Ids3(");
boolean first = true;
sb.append("another_micro_id:");
@ -508,7 +518,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
@ -516,16 +526,18 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
}
private static class Ids3StandardSchemeFactory implements SchemeFactory {
private static class Ids3StandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public Ids3StandardScheme getScheme() {
return new Ids3StandardScheme();
}
}
}
private static class Ids3StandardScheme extends StandardScheme<Ids3> {
private static class Ids3StandardScheme extends org.apache.thrift.scheme.StandardScheme<Ids3> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Ids3 struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -577,20 +589,21 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetAnotherMicroId()) {
throw new TProtocolException("Required field 'another_micro_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_micro_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAnotherMiniId()) {
throw new TProtocolException("Required field 'another_mini_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_mini_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAnotherId()) {
throw new TProtocolException("Required field 'another_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_id' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetAnotherBigId()) {
throw new TProtocolException("Required field 'another_big_id' was not found in serialized data! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'another_big_id' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Ids3 struct) throws org.apache.thrift.TException {
struct.validate();
@ -611,19 +624,20 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
oprot.writeStructEnd();
}
}
}
private static class Ids3TupleSchemeFactory implements SchemeFactory {
private static class Ids3TupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public Ids3TupleScheme getScheme() {
return new Ids3TupleScheme();
}
}
}
private static class Ids3TupleScheme extends TupleScheme<Ids3> {
private static class Ids3TupleScheme extends org.apache.thrift.scheme.TupleScheme<Ids3> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Ids3 struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeByte(struct.another_micro_id);
oprot.writeI16(struct.another_mini_id);
oprot.writeI32(struct.another_id);
@ -632,7 +646,7 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Ids3 struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.another_micro_id = iprot.readByte();
struct.setAnotherMicroIdIsSet(true);
struct.another_mini_id = iprot.readI16();
@ -642,10 +656,10 @@ public class Ids3 implements org.apache.thrift.TBase<Ids3, Ids3._Fields>, java.i
struct.another_big_id = iprot.readI64();
struct.setAnotherBigIdIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,33 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapListTest._Fields>, java.io.Serializable, Cloneable, Comparable<MapListTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MapListTest");
private static final org.apache.thrift.protocol.TField LIST_MAP_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("listMapString", org.apache.thrift.protocol.TType.LIST, (short)1);
private static final org.apache.thrift.protocol.TField LIST_MAP_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("listMapString", org.apache.thrift.protocol.TType.LIST, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new MapListTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new MapListTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new MapListTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new MapListTestTupleSchemeFactory();
public List<String> listMapString; // required
public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> listMapString; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
LIST_MAP_STRING((short)1, "listMapString");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -35,6 +34,7 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
/**
* 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: // LIST_MAP_STRING
@ -50,42 +50,45 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.LIST_MAP_STRING, new org.apache.thrift.meta_data.FieldMetaData("listMapString", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MapListTest.class, metaDataMap);
}
@ -93,7 +96,7 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
}
public MapListTest(
List<String> listMapString)
java.util.List<java.lang.String> listMapString)
{
this();
this.listMapString = listMapString;
@ -104,11 +107,12 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
*/
public MapListTest(MapListTest other) {
if (other.isSetListMapString()) {
List<String> __this__listMapString = new ArrayList<String>(other.listMapString);
java.util.List<java.lang.String> __this__listMapString = new java.util.ArrayList<java.lang.String>(other.listMapString);
this.listMapString = __this__listMapString;
}
}
@Override
public MapListTest deepCopy() {
return new MapListTest(this);
}
@ -122,22 +126,24 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
return (this.listMapString == null) ? 0 : this.listMapString.size();
}
public java.util.Iterator<String> getListMapStringIterator() {
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<java.lang.String> getListMapStringIterator() {
return (this.listMapString == null) ? null : this.listMapString.iterator();
}
}
public void addToListMapString(String elem) {
public void addToListMapString(java.lang.String elem) {
if (this.listMapString == null) {
this.listMapString = new ArrayList<String>();
this.listMapString = new java.util.ArrayList<java.lang.String>();
}
this.listMapString.add(elem);
}
}
public List<String> getListMapString() {
@org.apache.thrift.annotation.Nullable
public java.util.List<java.lang.String> getListMapString() {
return this.listMapString;
}
}
public MapListTest setListMapString(List<String> listMapString) {
public MapListTest setListMapString(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> listMapString) {
this.listMapString = listMapString;
return this;
}
@ -157,45 +163,47 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case LIST_MAP_STRING:
if (value == null) {
unsetListMapString();
} else {
setListMapString((List<String>)value);
setListMapString((java.util.List<java.lang.String>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case LIST_MAP_STRING:
return getListMapString();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case LIST_MAP_STRING:
return isSetListMapString();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof MapListTest)
return this.equals((MapListTest)that);
return false;
@ -204,6 +212,8 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
public boolean equals(MapListTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_listMapString = true && this.isSetListMapString();
boolean that_present_listMapString = true && that.isSetListMapString();
@ -236,7 +246,7 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetListMapString()).compareTo(other.isSetListMapString());
lastComparison = java.lang.Boolean.compare(isSetListMapString(), other.isSetListMapString());
if (lastComparison != 0) {
return lastComparison;
}
@ -249,6 +259,8 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -257,21 +269,23 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("MapListTest(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("MapListTest(");
boolean first = true;
sb.append("listMapString:");
@ -298,22 +312,24 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 MapListTestStandardSchemeFactory implements SchemeFactory {
private static class MapListTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public MapListTestStandardScheme getScheme() {
return new MapListTestStandardScheme();
}
}
}
private static class MapListTestStandardScheme extends StandardScheme<MapListTest> {
private static class MapListTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<MapListTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, MapListTest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -328,8 +344,8 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list168 = iprot.readListBegin();
struct.listMapString = new ArrayList<String>(_list168.size);
String _elem169;
struct.listMapString = new java.util.ArrayList<java.lang.String>(_list168.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem169;
for (int _i170 = 0; _i170 < _list168.size; ++_i170)
{
_elem169 = iprot.readString();
@ -351,8 +367,9 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, MapListTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -361,7 +378,7 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
oprot.writeFieldBegin(LIST_MAP_STRING_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.listMapString.size()));
for (String _iter171 : struct.listMapString)
for (java.lang.String _iter171 : struct.listMapString)
{
oprot.writeString(_iter171);
}
@ -373,20 +390,21 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
oprot.writeStructEnd();
}
}
}
private static class MapListTestTupleSchemeFactory implements SchemeFactory {
private static class MapListTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public MapListTestTupleScheme getScheme() {
return new MapListTestTupleScheme();
}
}
}
private static class MapListTestTupleScheme extends TupleScheme<MapListTest> {
private static class MapListTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<MapListTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, MapListTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetListMapString()) {
optionals.set(0);
}
@ -394,7 +412,7 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
if (struct.isSetListMapString()) {
{
oprot.writeI32(struct.listMapString.size());
for (String _iter172 : struct.listMapString)
for (java.lang.String _iter172 : struct.listMapString)
{
oprot.writeString(_iter172);
}
@ -404,13 +422,13 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, MapListTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list173 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.listMapString = new ArrayList<String>(_list173.size);
String _elem174;
{
org.apache.thrift.protocol.TList _list173 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
struct.listMapString = new java.util.ArrayList<java.lang.String>(_list173.size);
@org.apache.thrift.annotation.Nullable java.lang.String _elem174;
for (int _i175 = 0; _i175 < _list173.size; ++_i175)
{
_elem174 = iprot.readString();
@ -420,10 +438,10 @@ public class MapListTest implements org.apache.thrift.TBase<MapListTest, MapList
struct.setListMapStringIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,29 +1,27 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields>, java.io.Serializable, Cloneable, Comparable<MapTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MapTest");
private static final org.apache.thrift.protocol.TField ENUM_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("enumMap", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField IDS_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("idsMap", org.apache.thrift.protocol.TType.MAP, (short)2);
private static final org.apache.thrift.protocol.TField STATUS_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("statusMap", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final org.apache.thrift.protocol.TField STATUS_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("statusMap", org.apache.thrift.protocol.TType.MAP, (short) 3);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new MapTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new MapTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new MapTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new MapTestTupleSchemeFactory();
public Map<Enums,String> enumMap; // required
public Map<Ids,String> idsMap; // optional
public Map<Status,String> statusMap; // optional
public @org.apache.thrift.annotation.Nullable java.util.Map<Enums, java.lang.String> enumMap; // required
public @org.apache.thrift.annotation.Nullable java.util.Map<Ids, java.lang.String> idsMap; // optional
public @org.apache.thrift.annotation.Nullable java.util.Map<Status, java.lang.String> statusMap; // 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 {
@ -31,10 +29,10 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
IDS_MAP((short)2, "idsMap"),
STATUS_MAP((short)3, "statusMap");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -42,6 +40,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
/**
* 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: // ENUM_MAP
@ -61,39 +60,42 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.IDS_MAP, _Fields.STATUS_MAP};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.ENUM_MAP, new org.apache.thrift.meta_data.FieldMetaData("enumMap", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Enums.class),
@ -106,7 +108,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Status.class),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MapTest.class, metaDataMap);
}
@ -114,7 +116,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
public MapTest(
Map<Enums,String> enumMap)
java.util.Map<Enums, java.lang.String> enumMap)
{
this();
this.enumMap = enumMap;
@ -125,45 +127,45 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
*/
public MapTest(MapTest other) {
if (other.isSetEnumMap()) {
Map<Enums,String> __this__enumMap = new HashMap<Enums,String>(other.enumMap.size());
for (Map.Entry<Enums, String> other_element : other.enumMap.entrySet()) {
java.util.Map<Enums, java.lang.String> __this__enumMap = new java.util.EnumMap<Enums, java.lang.String>(Enums.class);
for (java.util.Map.Entry<Enums, java.lang.String> other_element : other.enumMap.entrySet()) {
Enums other_element_key = other_element.getKey();
String other_element_value = other_element.getValue();
java.lang.String other_element_value = other_element.getValue();
Enums __this__enumMap_copy_key = other_element_key;
String __this__enumMap_copy_value = other_element_value;
java.lang.String __this__enumMap_copy_value = other_element_value;
__this__enumMap.put(__this__enumMap_copy_key, __this__enumMap_copy_value);
}
this.enumMap = __this__enumMap;
}
if (other.isSetIdsMap()) {
Map<Ids,String> __this__idsMap = new HashMap<Ids,String>(other.idsMap.size());
for (Map.Entry<Ids, String> other_element : other.idsMap.entrySet()) {
java.util.Map<Ids, java.lang.String> __this__idsMap = new java.util.HashMap<Ids, java.lang.String>(other.idsMap.size());
for (java.util.Map.Entry<Ids, java.lang.String> other_element : other.idsMap.entrySet()) {
Ids other_element_key = other_element.getKey();
String other_element_value = other_element.getValue();
java.lang.String other_element_value = other_element.getValue();
Ids __this__idsMap_copy_key = other_element_key;
Ids __this__idsMap_copy_key = new Ids(other_element_key);
String __this__idsMap_copy_value = other_element_value;
java.lang.String __this__idsMap_copy_value = other_element_value;
__this__idsMap.put(__this__idsMap_copy_key, __this__idsMap_copy_value);
}
this.idsMap = __this__idsMap;
}
if (other.isSetStatusMap()) {
Map<Status,String> __this__statusMap = new HashMap<Status,String>(other.statusMap.size());
for (Map.Entry<Status, String> other_element : other.statusMap.entrySet()) {
java.util.Map<Status, java.lang.String> __this__statusMap = new java.util.HashMap<Status, java.lang.String>(other.statusMap.size());
for (java.util.Map.Entry<Status, java.lang.String> other_element : other.statusMap.entrySet()) {
Status other_element_key = other_element.getKey();
String other_element_value = other_element.getValue();
java.lang.String other_element_value = other_element.getValue();
Status __this__statusMap_copy_key = other_element_key;
Status __this__statusMap_copy_key = new Status(other_element_key);
String __this__statusMap_copy_value = other_element_value;
java.lang.String __this__statusMap_copy_value = other_element_value;
__this__statusMap.put(__this__statusMap_copy_key, __this__statusMap_copy_value);
}
@ -171,6 +173,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
}
@Override
public MapTest deepCopy() {
return new MapTest(this);
}
@ -186,18 +189,19 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return (this.enumMap == null) ? 0 : this.enumMap.size();
}
public void putToEnumMap(Enums key, String val) {
public void putToEnumMap(Enums key, java.lang.String val) {
if (this.enumMap == null) {
this.enumMap = new HashMap<Enums,String>();
this.enumMap = new java.util.EnumMap<Enums, java.lang.String>(Enums.class);
}
this.enumMap.put(key, val);
}
}
public Map<Enums,String> getEnumMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<Enums, java.lang.String> getEnumMap() {
return this.enumMap;
}
}
public MapTest setEnumMap(Map<Enums,String> enumMap) {
public MapTest setEnumMap(@org.apache.thrift.annotation.Nullable java.util.Map<Enums, java.lang.String> enumMap) {
this.enumMap = enumMap;
return this;
}
@ -221,18 +225,19 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return (this.idsMap == null) ? 0 : this.idsMap.size();
}
public void putToIdsMap(Ids key, String val) {
public void putToIdsMap(Ids key, java.lang.String val) {
if (this.idsMap == null) {
this.idsMap = new HashMap<Ids,String>();
this.idsMap = new java.util.HashMap<Ids, java.lang.String>();
}
this.idsMap.put(key, val);
}
}
public Map<Ids,String> getIdsMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<Ids, java.lang.String> getIdsMap() {
return this.idsMap;
}
}
public MapTest setIdsMap(Map<Ids,String> idsMap) {
public MapTest setIdsMap(@org.apache.thrift.annotation.Nullable java.util.Map<Ids, java.lang.String> idsMap) {
this.idsMap = idsMap;
return this;
}
@ -256,18 +261,19 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return (this.statusMap == null) ? 0 : this.statusMap.size();
}
public void putToStatusMap(Status key, String val) {
public void putToStatusMap(Status key, java.lang.String val) {
if (this.statusMap == null) {
this.statusMap = new HashMap<Status,String>();
this.statusMap = new java.util.HashMap<Status, java.lang.String>();
}
this.statusMap.put(key, val);
}
}
public Map<Status,String> getStatusMap() {
@org.apache.thrift.annotation.Nullable
public java.util.Map<Status, java.lang.String> getStatusMap() {
return this.statusMap;
}
}
public MapTest setStatusMap(Map<Status,String> statusMap) {
public MapTest setStatusMap(@org.apache.thrift.annotation.Nullable java.util.Map<Status, java.lang.String> statusMap) {
this.statusMap = statusMap;
return this;
}
@ -287,13 +293,14 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ENUM_MAP:
if (value == null) {
unsetEnumMap();
} else {
setEnumMap((Map<Enums,String>)value);
setEnumMap((java.util.Map<Enums, java.lang.String>) value);
}
break;
@ -301,7 +308,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (value == null) {
unsetIdsMap();
} else {
setIdsMap((Map<Ids,String>)value);
setIdsMap((java.util.Map<Ids, java.lang.String>) value);
}
break;
@ -309,14 +316,16 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (value == null) {
unsetStatusMap();
} else {
setStatusMap((Map<Status,String>)value);
setStatusMap((java.util.Map<Status, java.lang.String>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ENUM_MAP:
return getEnumMap();
@ -328,13 +337,14 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return getStatusMap();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -345,13 +355,11 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
case STATUS_MAP:
return isSetStatusMap();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof MapTest)
return this.equals((MapTest)that);
return false;
@ -360,6 +368,8 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
public boolean equals(MapTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_enumMap = true && this.isSetEnumMap();
boolean that_present_enumMap = true && that.isSetEnumMap();
@ -418,7 +428,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetEnumMap()).compareTo(other.isSetEnumMap());
lastComparison = java.lang.Boolean.compare(isSetEnumMap(), other.isSetEnumMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -428,7 +438,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetIdsMap()).compareTo(other.isSetIdsMap());
lastComparison = java.lang.Boolean.compare(isSetIdsMap(), other.isSetIdsMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -438,7 +448,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatusMap()).compareTo(other.isSetStatusMap());
lastComparison = java.lang.Boolean.compare(isSetStatusMap(), other.isSetStatusMap());
if (lastComparison != 0) {
return lastComparison;
}
@ -451,6 +461,8 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -459,21 +471,23 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("MapTest(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("MapTest(");
boolean first = true;
sb.append("enumMap:");
@ -510,7 +524,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (enumMap == null) {
throw new TProtocolException("Required field 'enumMap' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'enumMap' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -523,29 +537,31 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 MapTestStandardSchemeFactory implements SchemeFactory {
private static class MapTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public MapTestStandardScheme getScheme() {
return new MapTestStandardScheme();
}
}
}
private static class MapTestStandardScheme extends StandardScheme<MapTest> {
private static class MapTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<MapTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, MapTest 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) {
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
@ -553,19 +569,20 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map104 = iprot.readMapBegin();
struct.enumMap = new HashMap<Enums,String>(2*_map104.size);
Enums _key105;
String _val106;
for (int _i107 = 0; _i107 < _map104.size; ++_i107)
{
_key105 = Enums.findByValue(iprot.readI32());
struct.enumMap = new java.util.EnumMap<Enums, java.lang.String>(Enums.class);
@org.apache.thrift.annotation.Nullable Enums _key105;
@org.apache.thrift.annotation.Nullable java.lang.String _val106;
for (int _i107 = 0; _i107 < _map104.size; ++_i107) {
_key105 = dev.vality.geck.serializer.domain.Enums.findByValue(iprot.readI32());
_val106 = iprot.readString();
struct.enumMap.put(_key105, _val106);
if (_key105 != null) {
struct.enumMap.put(_key105, _val106);
}
}
iprot.readMapEnd();
}
struct.setEnumMapIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -573,9 +590,9 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map108 = iprot.readMapBegin();
struct.idsMap = new HashMap<Ids,String>(2*_map108.size);
Ids _key109;
String _val110;
struct.idsMap = new java.util.HashMap<Ids, java.lang.String>(2 * _map108.size);
@org.apache.thrift.annotation.Nullable Ids _key109;
@org.apache.thrift.annotation.Nullable java.lang.String _val110;
for (int _i111 = 0; _i111 < _map108.size; ++_i111)
{
_key109 = new Ids();
@ -586,7 +603,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
iprot.readMapEnd();
}
struct.setIdsMapIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -594,9 +611,9 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map112 = iprot.readMapBegin();
struct.statusMap = new HashMap<Status,String>(2*_map112.size);
Status _key113;
String _val114;
struct.statusMap = new java.util.HashMap<Status, java.lang.String>(2 * _map112.size);
@org.apache.thrift.annotation.Nullable Status _key113;
@org.apache.thrift.annotation.Nullable java.lang.String _val114;
for (int _i115 = 0; _i115 < _map112.size; ++_i115)
{
_key113 = new Status();
@ -607,7 +624,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
iprot.readMapEnd();
}
struct.setStatusMapIsSet(true);
} else {
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
@ -620,8 +637,9 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, MapTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -630,7 +648,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
oprot.writeFieldBegin(ENUM_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.enumMap.size()));
for (Map.Entry<Enums, String> _iter116 : struct.enumMap.entrySet())
for (java.util.Map.Entry<Enums, java.lang.String> _iter116 : struct.enumMap.entrySet())
{
oprot.writeI32(_iter116.getKey().getValue());
oprot.writeString(_iter116.getValue());
@ -644,7 +662,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
oprot.writeFieldBegin(IDS_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRING, struct.idsMap.size()));
for (Map.Entry<Ids, String> _iter117 : struct.idsMap.entrySet())
for (java.util.Map.Entry<Ids, java.lang.String> _iter117 : struct.idsMap.entrySet())
{
_iter117.getKey().write(oprot);
oprot.writeString(_iter117.getValue());
@ -659,7 +677,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
oprot.writeFieldBegin(STATUS_MAP_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRING, struct.statusMap.size()));
for (Map.Entry<Status, String> _iter118 : struct.statusMap.entrySet())
for (java.util.Map.Entry<Status, java.lang.String> _iter118 : struct.statusMap.entrySet())
{
_iter118.getKey().write(oprot);
oprot.writeString(_iter118.getValue());
@ -673,28 +691,29 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
oprot.writeStructEnd();
}
}
}
private static class MapTestTupleSchemeFactory implements SchemeFactory {
private static class MapTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public MapTestTupleScheme getScheme() {
return new MapTestTupleScheme();
}
}
}
private static class MapTestTupleScheme extends TupleScheme<MapTest> {
private static class MapTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<MapTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, MapTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
{
oprot.writeI32(struct.enumMap.size());
for (Map.Entry<Enums, String> _iter119 : struct.enumMap.entrySet())
for (java.util.Map.Entry<Enums, java.lang.String> _iter119 : struct.enumMap.entrySet())
{
oprot.writeI32(_iter119.getKey().getValue());
oprot.writeString(_iter119.getValue());
}
}
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetIdsMap()) {
optionals.set(0);
}
@ -705,7 +724,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (struct.isSetIdsMap()) {
{
oprot.writeI32(struct.idsMap.size());
for (Map.Entry<Ids, String> _iter120 : struct.idsMap.entrySet())
for (java.util.Map.Entry<Ids, java.lang.String> _iter120 : struct.idsMap.entrySet())
{
_iter120.getKey().write(oprot);
oprot.writeString(_iter120.getValue());
@ -715,7 +734,7 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
if (struct.isSetStatusMap()) {
{
oprot.writeI32(struct.statusMap.size());
for (Map.Entry<Status, String> _iter121 : struct.statusMap.entrySet())
for (java.util.Map.Entry<Status, java.lang.String> _iter121 : struct.statusMap.entrySet())
{
_iter121.getKey().write(oprot);
oprot.writeString(_iter121.getValue());
@ -726,27 +745,28 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, MapTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
{
org.apache.thrift.protocol.TMap _map122 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.enumMap = new HashMap<Enums,String>(2*_map122.size);
Enums _key123;
String _val124;
for (int _i125 = 0; _i125 < _map122.size; ++_i125)
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
{
_key123 = Enums.findByValue(iprot.readI32());
org.apache.thrift.protocol.TMap _map122 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING);
struct.enumMap = new java.util.EnumMap<Enums, java.lang.String>(Enums.class);
@org.apache.thrift.annotation.Nullable Enums _key123;
@org.apache.thrift.annotation.Nullable java.lang.String _val124;
for (int _i125 = 0; _i125 < _map122.size; ++_i125) {
_key123 = dev.vality.geck.serializer.domain.Enums.findByValue(iprot.readI32());
_val124 = iprot.readString();
struct.enumMap.put(_key123, _val124);
if (_key123 != null) {
struct.enumMap.put(_key123, _val124);
}
}
}
struct.setEnumMapIsSet(true);
BitSet incoming = iprot.readBitSet(2);
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TMap _map126 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.idsMap = new HashMap<Ids,String>(2*_map126.size);
Ids _key127;
String _val128;
{
org.apache.thrift.protocol.TMap _map126 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRING);
struct.idsMap = new java.util.HashMap<Ids, java.lang.String>(2 * _map126.size);
@org.apache.thrift.annotation.Nullable Ids _key127;
@org.apache.thrift.annotation.Nullable java.lang.String _val128;
for (int _i129 = 0; _i129 < _map126.size; ++_i129)
{
_key127 = new Ids();
@ -758,11 +778,11 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
struct.setIdsMapIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TMap _map130 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.statusMap = new HashMap<Status,String>(2*_map130.size);
Status _key131;
String _val132;
{
org.apache.thrift.protocol.TMap _map130 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.STRING);
struct.statusMap = new java.util.HashMap<Status, java.lang.String>(2 * _map130.size);
@org.apache.thrift.annotation.Nullable Status _key131;
@org.apache.thrift.annotation.Nullable java.lang.String _val132;
for (int _i133 = 0; _i133 < _map130.size; ++_i133)
{
_key131 = new Status();
@ -774,10 +794,10 @@ public class MapTest implements org.apache.thrift.TBase<MapTest, MapTest._Fields
struct.setStatusMapIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,31 +1,30 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Serializable, Cloneable, Comparable<Ok> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Ok");
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new OkStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new OkTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OkStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OkTupleSchemeFactory();
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -33,6 +32,7 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
/**
* 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) {
default:
@ -46,37 +46,41 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Ok.class, metaDataMap);
}
@ -89,6 +93,7 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
public Ok(Ok other) {
}
@Override
public Ok deepCopy() {
return new Ok(this);
}
@ -97,32 +102,34 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Ok)
return this.equals((Ok)that);
return false;
@ -131,6 +138,8 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
public boolean equals(Ok that) {
if (that == null)
return false;
if (this == that)
return true;
return true;
}
@ -153,6 +162,8 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -161,21 +172,23 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Ok(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Ok(");
boolean first = true;
sb.append(")");
@ -195,22 +208,24 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 OkStandardSchemeFactory implements SchemeFactory {
private static class OkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public OkStandardScheme getScheme() {
return new OkStandardScheme();
}
}
}
private static class OkStandardScheme extends StandardScheme<Ok> {
private static class OkStandardScheme extends org.apache.thrift.scheme.StandardScheme<Ok> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Ok struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -230,8 +245,9 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Ok struct) throws org.apache.thrift.TException {
struct.validate();
@ -240,29 +256,30 @@ public class Ok implements org.apache.thrift.TBase<Ok, Ok._Fields>, java.io.Seri
oprot.writeStructEnd();
}
}
}
private static class OkTupleSchemeFactory implements SchemeFactory {
private static class OkTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public OkTupleScheme getScheme() {
return new OkTupleScheme();
}
}
}
private static class OkTupleScheme extends TupleScheme<Ok> {
private static class OkTupleScheme extends org.apache.thrift.scheme.TupleScheme<Ok> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Ok struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Ok struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,37 +1,35 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields>, java.io.Serializable, Cloneable, Comparable<SetTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetTest");
private static final org.apache.thrift.protocol.TField IDS_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("idsSet", org.apache.thrift.protocol.TType.SET, (short)1);
private static final org.apache.thrift.protocol.TField STATUS_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("statusSet", org.apache.thrift.protocol.TType.SET, (short)2);
private static final org.apache.thrift.protocol.TField STATUS_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("statusSet", org.apache.thrift.protocol.TType.SET, (short) 2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new SetTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new SetTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetTestTupleSchemeFactory();
public Set<Ids> idsSet; // required
public Set<Status> statusSet; // optional
public @org.apache.thrift.annotation.Nullable java.util.Set<Ids> idsSet; // required
public @org.apache.thrift.annotation.Nullable java.util.Set<Status> statusSet; // 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 {
IDS_SET((short)1, "idsSet"),
STATUS_SET((short)2, "statusSet");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -39,6 +37,7 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
/**
* 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: // IDS_SET
@ -56,46 +55,49 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.STATUS_SET};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.IDS_SET, new org.apache.thrift.meta_data.FieldMetaData("idsSet", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Ids.class))));
tmpMap.put(_Fields.STATUS_SET, new org.apache.thrift.meta_data.FieldMetaData("statusSet", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Status.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetTest.class, metaDataMap);
}
@ -103,7 +105,7 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
}
public SetTest(
Set<Ids> idsSet)
java.util.Set<Ids> idsSet)
{
this();
this.idsSet = idsSet;
@ -114,21 +116,22 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
*/
public SetTest(SetTest other) {
if (other.isSetIdsSet()) {
Set<Ids> __this__idsSet = new HashSet<Ids>(other.idsSet.size());
java.util.Set<Ids> __this__idsSet = new java.util.HashSet<Ids>(other.idsSet.size());
for (Ids other_element : other.idsSet) {
__this__idsSet.add(other_element);
__this__idsSet.add(new Ids(other_element));
}
this.idsSet = __this__idsSet;
}
if (other.isSetStatusSet()) {
Set<Status> __this__statusSet = new HashSet<Status>(other.statusSet.size());
java.util.Set<Status> __this__statusSet = new java.util.HashSet<Status>(other.statusSet.size());
for (Status other_element : other.statusSet) {
__this__statusSet.add(other_element);
__this__statusSet.add(new Status(other_element));
}
this.statusSet = __this__statusSet;
}
}
@Override
public SetTest deepCopy() {
return new SetTest(this);
}
@ -143,22 +146,24 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
return (this.idsSet == null) ? 0 : this.idsSet.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<Ids> getIdsSetIterator() {
return (this.idsSet == null) ? null : this.idsSet.iterator();
}
public void addToIdsSet(Ids elem) {
if (this.idsSet == null) {
this.idsSet = new HashSet<Ids>();
this.idsSet = new java.util.HashSet<Ids>();
}
this.idsSet.add(elem);
}
public Set<Ids> getIdsSet() {
@org.apache.thrift.annotation.Nullable
public java.util.Set<Ids> getIdsSet() {
return this.idsSet;
}
}
public SetTest setIdsSet(Set<Ids> idsSet) {
public SetTest setIdsSet(@org.apache.thrift.annotation.Nullable java.util.Set<Ids> idsSet) {
this.idsSet = idsSet;
return this;
}
@ -182,22 +187,24 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
return (this.statusSet == null) ? 0 : this.statusSet.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<Status> getStatusSetIterator() {
return (this.statusSet == null) ? null : this.statusSet.iterator();
}
public void addToStatusSet(Status elem) {
if (this.statusSet == null) {
this.statusSet = new HashSet<Status>();
this.statusSet = new java.util.HashSet<Status>();
}
this.statusSet.add(elem);
}
public Set<Status> getStatusSet() {
@org.apache.thrift.annotation.Nullable
public java.util.Set<Status> getStatusSet() {
return this.statusSet;
}
}
public SetTest setStatusSet(Set<Status> statusSet) {
public SetTest setStatusSet(@org.apache.thrift.annotation.Nullable java.util.Set<Status> statusSet) {
this.statusSet = statusSet;
return this;
}
@ -217,13 +224,14 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case IDS_SET:
if (value == null) {
unsetIdsSet();
} else {
setIdsSet((Set<Ids>)value);
setIdsSet((java.util.Set<Ids>) value);
}
break;
@ -231,14 +239,16 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
if (value == null) {
unsetStatusSet();
} else {
setStatusSet((Set<Status>)value);
setStatusSet((java.util.Set<Status>) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case IDS_SET:
return getIdsSet();
@ -247,13 +257,14 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
return getStatusSet();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
@ -262,13 +273,11 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
case STATUS_SET:
return isSetStatusSet();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof SetTest)
return this.equals((SetTest)that);
return false;
@ -277,6 +286,8 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
public boolean equals(SetTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_idsSet = true && this.isSetIdsSet();
boolean that_present_idsSet = true && that.isSetIdsSet();
@ -322,7 +333,7 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetIdsSet()).compareTo(other.isSetIdsSet());
lastComparison = java.lang.Boolean.compare(isSetIdsSet(), other.isSetIdsSet());
if (lastComparison != 0) {
return lastComparison;
}
@ -332,7 +343,7 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatusSet()).compareTo(other.isSetStatusSet());
lastComparison = java.lang.Boolean.compare(isSetStatusSet(), other.isSetStatusSet());
if (lastComparison != 0) {
return lastComparison;
}
@ -345,6 +356,8 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -353,21 +366,23 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("SetTest(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("SetTest(");
boolean first = true;
sb.append("idsSet:");
@ -394,7 +409,7 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (idsSet == null) {
throw new TProtocolException("Required field 'idsSet' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'idsSet' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -407,22 +422,24 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 SetTestStandardSchemeFactory implements SchemeFactory {
private static class SetTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public SetTestStandardScheme getScheme() {
return new SetTestStandardScheme();
}
}
}
private static class SetTestStandardScheme extends StandardScheme<SetTest> {
private static class SetTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<SetTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, SetTest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -437,8 +454,8 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set88 = iprot.readSetBegin();
struct.idsSet = new HashSet<Ids>(2*_set88.size);
Ids _elem89;
struct.idsSet = new java.util.HashSet<Ids>(2 * _set88.size);
@org.apache.thrift.annotation.Nullable Ids _elem89;
for (int _i90 = 0; _i90 < _set88.size; ++_i90)
{
_elem89 = new Ids();
@ -456,8 +473,8 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
{
org.apache.thrift.protocol.TSet _set91 = iprot.readSetBegin();
struct.statusSet = new HashSet<Status>(2*_set91.size);
Status _elem92;
struct.statusSet = new java.util.HashSet<Status>(2 * _set91.size);
@org.apache.thrift.annotation.Nullable Status _elem92;
for (int _i93 = 0; _i93 < _set91.size; ++_i93)
{
_elem92 = new Status();
@ -480,8 +497,9 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, SetTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -516,19 +534,20 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
oprot.writeStructEnd();
}
}
}
private static class SetTestTupleSchemeFactory implements SchemeFactory {
private static class SetTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public SetTestTupleScheme getScheme() {
return new SetTestTupleScheme();
}
}
}
private static class SetTestTupleScheme extends TupleScheme<SetTest> {
private static class SetTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<SetTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SetTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
{
oprot.writeI32(struct.idsSet.size());
for (Ids _iter96 : struct.idsSet)
@ -536,7 +555,7 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
_iter96.write(oprot);
}
}
BitSet optionals = new BitSet();
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetStatusSet()) {
optionals.set(0);
}
@ -554,11 +573,11 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, SetTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
{
org.apache.thrift.protocol.TSet _set98 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.idsSet = new HashSet<Ids>(2*_set98.size);
Ids _elem99;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
{
org.apache.thrift.protocol.TSet _set98 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.idsSet = new java.util.HashSet<Ids>(2 * _set98.size);
@org.apache.thrift.annotation.Nullable Ids _elem99;
for (int _i100 = 0; _i100 < _set98.size; ++_i100)
{
_elem99 = new Ids();
@ -567,12 +586,12 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
}
}
struct.setIdsSetIsSet(true);
BitSet incoming = iprot.readBitSet(1);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TSet _set101 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.statusSet = new HashSet<Status>(2*_set101.size);
Status _elem102;
{
org.apache.thrift.protocol.TSet _set101 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.statusSet = new java.util.HashSet<Status>(2 * _set101.size);
@org.apache.thrift.annotation.Nullable Status _elem102;
for (int _i103 = 0; _i103 < _set101.size; ++_i103)
{
_elem102 = new Status();
@ -583,10 +602,10 @@ public class SetTest implements org.apache.thrift.TBase<SetTest, SetTest._Fields
struct.setStatusSetIsSet(true);
}
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,9 +1,14 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import java.util.*;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Status");
private static final org.apache.thrift.protocol.TField OK_FIELD_DESC = new org.apache.thrift.protocol.TField("ok", org.apache.thrift.protocol.TType.STRUCT, (short)1);
@ -16,10 +21,10 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
FAIL((short)2, "fail"),
UNKNOWN((short)3, "unknown");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -27,6 +32,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
/**
* 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: // OK
@ -46,44 +52,47 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.OK, new org.apache.thrift.meta_data.FieldMetaData("ok", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Ok.class)));
tmpMap.put(_Fields.FAIL, new org.apache.thrift.meta_data.FieldMetaData("fail", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Fail.class)));
tmpMap.put(_Fields.UNKNOWN, new org.apache.thrift.meta_data.FieldMetaData("unknown", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Unknown.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Status.class, metaDataMap);
}
@ -91,13 +100,15 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
super();
}
public Status(_Fields setField, Object value) {
public Status(_Fields setField, java.lang.Object value) {
super(setField, value);
}
public Status(Status other) {
super(other);
}
@Override
public Status deepCopy() {
return new Status(this);
}
@ -122,30 +133,30 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
@Override
protected void checkType(_Fields setField, Object value) throws ClassCastException {
protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {
switch (setField) {
case OK:
if (value instanceof Ok) {
break;
}
throw new ClassCastException("Was expecting value of type Ok for field 'ok', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type Ok for field 'ok', but got " + value.getClass().getSimpleName());
case FAIL:
if (value instanceof Fail) {
break;
}
throw new ClassCastException("Was expecting value of type Fail for field 'fail', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type Fail for field 'fail', but got " + value.getClass().getSimpleName());
case UNKNOWN:
if (value instanceof Unknown) {
break;
}
throw new ClassCastException("Was expecting value of type Unknown for field 'unknown', but got " + value.getClass().getSimpleName());
throw new java.lang.ClassCastException("Was expecting value of type Unknown for field 'unknown', but got " + value.getClass().getSimpleName());
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@Override
protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(field.id);
if (setField != null) {
switch (setField) {
@ -180,7 +191,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
return null;
}
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
@ -204,12 +215,12 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
unknown.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@Override
protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {
_Fields setField = _Fields.findByThriftId(fieldID);
if (setField != null) {
switch (setField) {
@ -229,10 +240,10 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
unknown.read(iprot);
return unknown;
default:
throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!");
}
} else {
throw new TProtocolException("Couldn't find a field with field id " + fieldID);
throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID);
}
}
@ -252,7 +263,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
unknown.write(oprot);
return;
default:
throw new IllegalStateException("Cannot write union with unknown field " + setField_);
throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_);
}
}
@ -266,7 +277,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
case UNKNOWN:
return UNKNOWN_FIELD_DESC;
default:
throw new IllegalArgumentException("Unknown field id " + setField);
throw new java.lang.IllegalArgumentException("Unknown field id " + setField);
}
}
@ -284,10 +295,12 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -297,42 +310,39 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
if (getSetField() == _Fields.OK) {
return (Ok)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'ok' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'ok' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setOk(Ok value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.OK;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.OK");
}
public Fail getFail() {
if (getSetField() == _Fields.FAIL) {
return (Fail)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'fail' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'fail' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setFail(Fail value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.FAIL;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.FAIL");
}
public Unknown getUnknown() {
if (getSetField() == _Fields.UNKNOWN) {
return (Unknown)getFieldValue();
} else {
throw new RuntimeException("Cannot get field 'unknown' because union is currently set to " + getFieldDesc(getSetField()).name);
throw new java.lang.RuntimeException("Cannot get field 'unknown' because union is currently set to " + getFieldDesc(getSetField()).name);
}
}
public void setUnknown(Unknown value) {
if (value == null) throw new NullPointerException();
setField_ = _Fields.UNKNOWN;
value_ = value;
value_ = java.util.Objects.requireNonNull(value, "_Fields.UNKNOWN");
}
public boolean isSetOk() {
@ -350,7 +360,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
}
public boolean equals(Object other) {
public boolean equals(java.lang.Object other) {
if (other instanceof Status) {
return equals((Status)other);
} else {
@ -374,12 +384,12 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();
list.add(this.getClass().getName());
org.apache.thrift.TFieldIdEnum setField = getSetField();
if (setField != null) {
list.add(setField.getThriftFieldId());
Object value = getFieldValue();
java.lang.Object value = getFieldValue();
if (value instanceof org.apache.thrift.TEnum) {
list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());
} else {
@ -397,7 +407,7 @@ public class Status extends org.apache.thrift.TUnion<Status, Status._Fields> {
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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) {

View File

@ -1,34 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTest._Fields>, java.io.Serializable, Cloneable, Comparable<TUnionTest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTest");
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new TUnionTestStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new TUnionTestTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUnionTestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUnionTestTupleSchemeFactory();
public Status status; // required
public @org.apache.thrift.annotation.Nullable Status status; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
STATUS((short)1, "status");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -36,6 +34,7 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
/**
* 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: // STATUS
@ -51,41 +50,44 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Status.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTest.class, metaDataMap);
}
@ -108,6 +110,7 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
}
}
@Override
public TUnionTest deepCopy() {
return new TUnionTest(this);
}
@ -117,11 +120,12 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
this.status = null;
}
@org.apache.thrift.annotation.Nullable
public Status getStatus() {
return this.status;
}
}
public TUnionTest setStatus(Status status) {
public TUnionTest setStatus(@org.apache.thrift.annotation.Nullable Status status) {
this.status = status;
return this;
}
@ -141,7 +145,8 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case STATUS:
if (value == null) {
@ -152,34 +157,35 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case STATUS:
return getStatus();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case STATUS:
return isSetStatus();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof TUnionTest)
return this.equals((TUnionTest)that);
return false;
@ -188,6 +194,8 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
public boolean equals(TUnionTest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_status = true && this.isSetStatus();
boolean that_present_status = true && that.isSetStatus();
@ -220,7 +228,7 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
@ -233,6 +241,8 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -241,21 +251,23 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TUnionTest(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("TUnionTest(");
boolean first = true;
sb.append("status:");
@ -272,7 +284,7 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (status == null) {
throw new TProtocolException("Required field 'status' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -285,22 +297,24 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 TUnionTestStandardSchemeFactory implements SchemeFactory {
private static class TUnionTestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TUnionTestStandardScheme getScheme() {
return new TUnionTestStandardScheme();
}
}
}
private static class TUnionTestStandardScheme extends StandardScheme<TUnionTest> {
private static class TUnionTestStandardScheme extends org.apache.thrift.scheme.StandardScheme<TUnionTest> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -329,8 +343,9 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTest struct) throws org.apache.thrift.TException {
struct.validate();
@ -344,33 +359,34 @@ public class TUnionTest implements org.apache.thrift.TBase<TUnionTest, TUnionTes
oprot.writeStructEnd();
}
}
}
private static class TUnionTestTupleSchemeFactory implements SchemeFactory {
private static class TUnionTestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TUnionTestTupleScheme getScheme() {
return new TUnionTestTupleScheme();
}
}
}
private static class TUnionTestTupleScheme extends TupleScheme<TUnionTest> {
private static class TUnionTestTupleScheme extends org.apache.thrift.scheme.TupleScheme<TUnionTest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTest struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.status.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTest struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.status = new Status();
struct.status.read(iprot);
struct.setStatusIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}

View File

@ -1,34 +1,32 @@
/**
* Autogenerated by Thrift Compiler (0.20.0)
* <p>
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package dev.vality.geck.serializer.domain;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import javax.annotation.Generated;
import java.util.*;
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-07-09")
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@jakarta.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-06-24")
public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields>, java.io.Serializable, Cloneable, Comparable<Unknown> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Unknown");
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short) 1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new UnknownStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new UnknownTupleSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UnknownStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UnknownTupleSchemeFactory();
public String description; // required
public @org.apache.thrift.annotation.Nullable java.lang.String description; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
DESCRIPTION((short)1, "description");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@ -36,6 +34,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
/**
* 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: // DESCRIPTION
@ -51,41 +50,44 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
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.
*/
public static _Fields findByName(String name) {
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
private final java.lang.String _fieldName;
_Fields(short thriftId, String fieldName) {
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
}
public String getFieldName() {
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
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.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Unknown.class, metaDataMap);
}
@ -93,7 +95,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
public Unknown(
String description)
java.lang.String description)
{
this();
this.description = description;
@ -108,6 +110,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
@Override
public Unknown deepCopy() {
return new Unknown(this);
}
@ -117,11 +120,12 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
this.description = null;
}
public String getDescription() {
@org.apache.thrift.annotation.Nullable
public java.lang.String getDescription() {
return this.description;
}
}
public Unknown setDescription(String description) {
public Unknown setDescription(@org.apache.thrift.annotation.Nullable java.lang.String description) {
this.description = description;
return this;
}
@ -141,45 +145,47 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
public void setFieldValue(_Fields field, Object value) {
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case DESCRIPTION:
if (value == null) {
unsetDescription();
} else {
setDescription((String)value);
setDescription((java.lang.String) value);
}
break;
}
}
}
public Object getFieldValue(_Fields field) {
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case DESCRIPTION:
return getDescription();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case DESCRIPTION:
return isSetDescription();
}
throw new IllegalStateException();
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
public boolean equals(java.lang.Object that) {
if (that instanceof Unknown)
return this.equals((Unknown)that);
return false;
@ -188,6 +194,8 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
public boolean equals(Unknown that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_description = true && this.isSetDescription();
boolean that_present_description = true && that.isSetDescription();
@ -220,7 +228,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
lastComparison = java.lang.Boolean.compare(isSetDescription(), other.isSetDescription());
if (lastComparison != 0) {
return lastComparison;
}
@ -233,6 +241,8 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@ -241,21 +251,23 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Unknown(");
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("Unknown(");
boolean first = true;
sb.append("description:");
@ -272,7 +284,7 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (description == null) {
throw new TProtocolException("Required field 'description' was not present! Struct: " + toString());
throw new org.apache.thrift.protocol.TProtocolException("Required field 'description' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
@ -285,22 +297,24 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
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 UnknownStandardSchemeFactory implements SchemeFactory {
private static class UnknownStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public UnknownStandardScheme getScheme() {
return new UnknownStandardScheme();
}
}
}
private static class UnknownStandardScheme extends StandardScheme<Unknown> {
private static class UnknownStandardScheme extends org.apache.thrift.scheme.StandardScheme<Unknown> {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Unknown struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
@ -328,8 +342,9 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Unknown struct) throws org.apache.thrift.TException {
struct.validate();
@ -343,32 +358,33 @@ public class Unknown implements org.apache.thrift.TBase<Unknown, Unknown._Fields
oprot.writeStructEnd();
}
}
}
private static class UnknownTupleSchemeFactory implements SchemeFactory {
private static class UnknownTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public UnknownTupleScheme getScheme() {
return new UnknownTupleScheme();
}
}
}
private static class UnknownTupleScheme extends TupleScheme<Unknown> {
private static class UnknownTupleScheme extends org.apache.thrift.scheme.TupleScheme<Unknown> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Unknown struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.description);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Unknown struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.description = iprot.readString();
struct.setDescriptionIsSet(true);
}
}
}
private static <S extends IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
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();
}
}