/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * <p>DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *
 * @generated
 */
package org.apache.flink.benchmark.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(
        value = "Autogenerated by Thrift Compiler (0.13.0)",
        date = "2020-03-06")
public class MyPojo
        implements org.apache.thrift.TBase<MyPojo, MyPojo._Fields>,
                java.io.Serializable,
                Cloneable,
                Comparable<MyPojo> {
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData>
            metaDataMap;
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC =
            new org.apache.thrift.protocol.TStruct("MyPojo");
    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) 1);
    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "name", org.apache.thrift.protocol.TType.STRING, (short) 2);
    private static final org.apache.thrift.protocol.TField OPERATION_NAME_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "operationName", org.apache.thrift.protocol.TType.LIST, (short) 3);
    private static final org.apache.thrift.protocol.TField OPERATIONS_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "operations", org.apache.thrift.protocol.TType.LIST, (short) 4);
    private static final org.apache.thrift.protocol.TField OTHER_ID1_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "otherId1", org.apache.thrift.protocol.TType.I32, (short) 5);
    private static final org.apache.thrift.protocol.TField OTHER_ID2_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "otherId2", org.apache.thrift.protocol.TType.I32, (short) 6);
    private static final org.apache.thrift.protocol.TField OTHER_ID3_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "otherId3", org.apache.thrift.protocol.TType.I32, (short) 7);
    private static final org.apache.thrift.protocol.TField SOME_OBJECT_FIELD_DESC =
            new org.apache.thrift.protocol.TField(
                    "someObject", org.apache.thrift.protocol.TType.STRING, (short) 8);
    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
            new MyPojoStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
            new MyPojoTupleSchemeFactory();
    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private static final int __OTHERID1_ISSET_ID = 1;
    private static final int __OTHERID2_ISSET_ID = 2;
    private static final int __OTHERID3_ISSET_ID = 3;
    private static final _Fields optionals[] = {_Fields.SOME_OBJECT};

    static {
        java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap =
                new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(
                        _Fields.class);
        tmpMap.put(
                _Fields.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, "int")));
        tmpMap.put(
                _Fields.NAME,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "name",
                        org.apache.thrift.TFieldRequirementType.DEFAULT,
                        new org.apache.thrift.meta_data.FieldValueMetaData(
                                org.apache.thrift.protocol.TType.STRING)));
        tmpMap.put(
                _Fields.OPERATION_NAME,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "operationName",
                        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))));
        tmpMap.put(
                _Fields.OPERATIONS,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "operations",
                        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.STRUCT, "MyOperation"))));
        tmpMap.put(
                _Fields.OTHER_ID1,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "otherId1",
                        org.apache.thrift.TFieldRequirementType.DEFAULT,
                        new org.apache.thrift.meta_data.FieldValueMetaData(
                                org.apache.thrift.protocol.TType.I32, "int")));
        tmpMap.put(
                _Fields.OTHER_ID2,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "otherId2",
                        org.apache.thrift.TFieldRequirementType.DEFAULT,
                        new org.apache.thrift.meta_data.FieldValueMetaData(
                                org.apache.thrift.protocol.TType.I32, "int")));
        tmpMap.put(
                _Fields.OTHER_ID3,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "otherId3",
                        org.apache.thrift.TFieldRequirementType.DEFAULT,
                        new org.apache.thrift.meta_data.FieldValueMetaData(
                                org.apache.thrift.protocol.TType.I32, "int")));
        tmpMap.put(
                _Fields.SOME_OBJECT,
                new org.apache.thrift.meta_data.FieldMetaData(
                        "someObject",
                        org.apache.thrift.TFieldRequirementType.OPTIONAL,
                        new org.apache.thrift.meta_data.FieldValueMetaData(
                                org.apache.thrift.protocol.TType.STRING)));
        metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
        org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MyPojo.class, metaDataMap);
    }

    public int id; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String name; // required
    public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String>
            operationName; // required
    public @org.apache.thrift.annotation.Nullable java.util.List<MyOperation>
            operations; // required
    public int otherId1; // required
    public int otherId2; // required
    public int otherId3; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String someObject; // optional
    private byte __isset_bitfield = 0;

    public MyPojo() {}

    public MyPojo(
            int id,
            java.lang.String name,
            java.util.List<java.lang.String> operationName,
            java.util.List<MyOperation> operations,
            int otherId1,
            int otherId2,
            int otherId3) {
        this();
        this.id = id;
        setIdIsSet(true);
        this.name = name;
        this.operationName = operationName;
        this.operations = operations;
        this.otherId1 = otherId1;
        setOtherId1IsSet(true);
        this.otherId2 = otherId2;
        setOtherId2IsSet(true);
        this.otherId3 = otherId3;
        setOtherId3IsSet(true);
    }

    /** Performs a deep copy on <i>other</i>. */
    public MyPojo(MyPojo other) {
        __isset_bitfield = other.__isset_bitfield;
        this.id = other.id;
        if (other.isSetName()) {
            this.name = other.name;
        }
        if (other.isSetOperationName()) {
            java.util.List<java.lang.String> __this__operationName =
                    new java.util.ArrayList<java.lang.String>(other.operationName);
            this.operationName = __this__operationName;
        }
        if (other.isSetOperations()) {
            java.util.List<MyOperation> __this__operations =
                    new java.util.ArrayList<MyOperation>(other.operations.size());
            for (MyOperation other_element : other.operations) {
                __this__operations.add(new MyOperation(other_element));
            }
            this.operations = __this__operations;
        }
        this.otherId1 = other.otherId1;
        this.otherId2 = other.otherId2;
        this.otherId3 = other.otherId3;
        if (other.isSetSomeObject()) {
            this.someObject = other.someObject;
        }
    }

    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();
    }

    public MyPojo deepCopy() {
        return new MyPojo(this);
    }

    @Override
    public void clear() {
        setIdIsSet(false);
        this.id = 0;
        this.name = null;
        this.operationName = null;
        this.operations = null;
        setOtherId1IsSet(false);
        this.otherId1 = 0;
        setOtherId2IsSet(false);
        this.otherId2 = 0;
        setOtherId3IsSet(false);
        this.otherId3 = 0;
        this.someObject = null;
    }

    public int getId() {
        return this.id;
    }

    public MyPojo setId(int id) {
        this.id = id;
        setIdIsSet(true);
        return this;
    }

    public void unsetId() {
        __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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getName() {
        return this.name;
    }

    public MyPojo setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
        this.name = name;
        return this;
    }

    public void unsetName() {
        this.name = null;
    }

    /** Returns true if field name is set (has been assigned a value) and false otherwise */
    public boolean isSetName() {
        return this.name != null;
    }

    public void setNameIsSet(boolean value) {
        if (!value) {
            this.name = null;
        }
    }

    public int getOperationNameSize() {
        return (this.operationName == null) ? 0 : this.operationName.size();
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator<java.lang.String> getOperationNameIterator() {
        return (this.operationName == null) ? null : this.operationName.iterator();
    }

    public void addToOperationName(java.lang.String elem) {
        if (this.operationName == null) {
            this.operationName = new java.util.ArrayList<java.lang.String>();
        }
        this.operationName.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List<java.lang.String> getOperationName() {
        return this.operationName;
    }

    public MyPojo setOperationName(
            @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> operationName) {
        this.operationName = operationName;
        return this;
    }

    public void unsetOperationName() {
        this.operationName = null;
    }

    /**
     * Returns true if field operationName is set (has been assigned a value) and false otherwise
     */
    public boolean isSetOperationName() {
        return this.operationName != null;
    }

    public void setOperationNameIsSet(boolean value) {
        if (!value) {
            this.operationName = null;
        }
    }

    public int getOperationsSize() {
        return (this.operations == null) ? 0 : this.operations.size();
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator<MyOperation> getOperationsIterator() {
        return (this.operations == null) ? null : this.operations.iterator();
    }

    public void addToOperations(MyOperation elem) {
        if (this.operations == null) {
            this.operations = new java.util.ArrayList<MyOperation>();
        }
        this.operations.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List<MyOperation> getOperations() {
        return this.operations;
    }

    public MyPojo setOperations(
            @org.apache.thrift.annotation.Nullable java.util.List<MyOperation> operations) {
        this.operations = operations;
        return this;
    }

    public void unsetOperations() {
        this.operations = null;
    }

    /** Returns true if field operations is set (has been assigned a value) and false otherwise */
    public boolean isSetOperations() {
        return this.operations != null;
    }

    public void setOperationsIsSet(boolean value) {
        if (!value) {
            this.operations = null;
        }
    }

    public int getOtherId1() {
        return this.otherId1;
    }

    public MyPojo setOtherId1(int otherId1) {
        this.otherId1 = otherId1;
        setOtherId1IsSet(true);
        return this;
    }

    public void unsetOtherId1() {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OTHERID1_ISSET_ID);
    }

    /** Returns true if field otherId1 is set (has been assigned a value) and false otherwise */
    public boolean isSetOtherId1() {
        return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OTHERID1_ISSET_ID);
    }

    public void setOtherId1IsSet(boolean value) {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.setBit(
                        __isset_bitfield, __OTHERID1_ISSET_ID, value);
    }

    public int getOtherId2() {
        return this.otherId2;
    }

    public MyPojo setOtherId2(int otherId2) {
        this.otherId2 = otherId2;
        setOtherId2IsSet(true);
        return this;
    }

    public void unsetOtherId2() {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OTHERID2_ISSET_ID);
    }

    /** Returns true if field otherId2 is set (has been assigned a value) and false otherwise */
    public boolean isSetOtherId2() {
        return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OTHERID2_ISSET_ID);
    }

    public void setOtherId2IsSet(boolean value) {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.setBit(
                        __isset_bitfield, __OTHERID2_ISSET_ID, value);
    }

    public int getOtherId3() {
        return this.otherId3;
    }

    public MyPojo setOtherId3(int otherId3) {
        this.otherId3 = otherId3;
        setOtherId3IsSet(true);
        return this;
    }

    public void unsetOtherId3() {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OTHERID3_ISSET_ID);
    }

    /** Returns true if field otherId3 is set (has been assigned a value) and false otherwise */
    public boolean isSetOtherId3() {
        return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OTHERID3_ISSET_ID);
    }

    public void setOtherId3IsSet(boolean value) {
        __isset_bitfield =
                org.apache.thrift.EncodingUtils.setBit(
                        __isset_bitfield, __OTHERID3_ISSET_ID, value);
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSomeObject() {
        return this.someObject;
    }

    public MyPojo setSomeObject(
            @org.apache.thrift.annotation.Nullable java.lang.String someObject) {
        this.someObject = someObject;
        return this;
    }

    public void unsetSomeObject() {
        this.someObject = null;
    }

    /** Returns true if field someObject is set (has been assigned a value) and false otherwise */
    public boolean isSetSomeObject() {
        return this.someObject != null;
    }

    public void setSomeObjectIsSet(boolean value) {
        if (!value) {
            this.someObject = null;
        }
    }

    public void setFieldValue(
            _Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
        switch (field) {
            case ID:
                if (value == null) {
                    unsetId();
                } else {
                    setId((java.lang.Integer) value);
                }
                break;

            case NAME:
                if (value == null) {
                    unsetName();
                } else {
                    setName((java.lang.String) value);
                }
                break;

            case OPERATION_NAME:
                if (value == null) {
                    unsetOperationName();
                } else {
                    setOperationName((java.util.List<java.lang.String>) value);
                }
                break;

            case OPERATIONS:
                if (value == null) {
                    unsetOperations();
                } else {
                    setOperations((java.util.List<MyOperation>) value);
                }
                break;

            case OTHER_ID1:
                if (value == null) {
                    unsetOtherId1();
                } else {
                    setOtherId1((java.lang.Integer) value);
                }
                break;

            case OTHER_ID2:
                if (value == null) {
                    unsetOtherId2();
                } else {
                    setOtherId2((java.lang.Integer) value);
                }
                break;

            case OTHER_ID3:
                if (value == null) {
                    unsetOtherId3();
                } else {
                    setOtherId3((java.lang.Integer) value);
                }
                break;

            case SOME_OBJECT:
                if (value == null) {
                    unsetSomeObject();
                } else {
                    setSomeObject((java.lang.String) value);
                }
                break;
        }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
        switch (field) {
            case ID:
                return getId();

            case NAME:
                return getName();

            case OPERATION_NAME:
                return getOperationName();

            case OPERATIONS:
                return getOperations();

            case OTHER_ID1:
                return getOtherId1();

            case OTHER_ID2:
                return getOtherId2();

            case OTHER_ID3:
                return getOtherId3();

            case SOME_OBJECT:
                return getSomeObject();
        }
        throw new java.lang.IllegalStateException();
    }

    /**
     * Returns true if field corresponding to fieldID is set (has been assigned a value) and false
     * otherwise
     */
    public boolean isSet(_Fields field) {
        if (field == null) {
            throw new java.lang.IllegalArgumentException();
        }

        switch (field) {
            case ID:
                return isSetId();
            case NAME:
                return isSetName();
            case OPERATION_NAME:
                return isSetOperationName();
            case OPERATIONS:
                return isSetOperations();
            case OTHER_ID1:
                return isSetOtherId1();
            case OTHER_ID2:
                return isSetOtherId2();
            case OTHER_ID3:
                return isSetOtherId3();
            case SOME_OBJECT:
                return isSetSomeObject();
        }
        throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
        if (that == null) return false;
        if (that instanceof MyPojo) return this.equals((MyPojo) that);
        return false;
    }

    public boolean equals(MyPojo that) {
        if (that == null) return false;
        if (this == that) return true;

        boolean this_present_id = true;
        boolean that_present_id = true;
        if (this_present_id || that_present_id) {
            if (!(this_present_id && that_present_id)) return false;
            if (this.id != that.id) return false;
        }

        boolean this_present_name = true && this.isSetName();
        boolean that_present_name = true && that.isSetName();
        if (this_present_name || that_present_name) {
            if (!(this_present_name && that_present_name)) return false;
            if (!this.name.equals(that.name)) return false;
        }

        boolean this_present_operationName = true && this.isSetOperationName();
        boolean that_present_operationName = true && that.isSetOperationName();
        if (this_present_operationName || that_present_operationName) {
            if (!(this_present_operationName && that_present_operationName)) return false;
            if (!this.operationName.equals(that.operationName)) return false;
        }

        boolean this_present_operations = true && this.isSetOperations();
        boolean that_present_operations = true && that.isSetOperations();
        if (this_present_operations || that_present_operations) {
            if (!(this_present_operations && that_present_operations)) return false;
            if (!this.operations.equals(that.operations)) return false;
        }

        boolean this_present_otherId1 = true;
        boolean that_present_otherId1 = true;
        if (this_present_otherId1 || that_present_otherId1) {
            if (!(this_present_otherId1 && that_present_otherId1)) return false;
            if (this.otherId1 != that.otherId1) return false;
        }

        boolean this_present_otherId2 = true;
        boolean that_present_otherId2 = true;
        if (this_present_otherId2 || that_present_otherId2) {
            if (!(this_present_otherId2 && that_present_otherId2)) return false;
            if (this.otherId2 != that.otherId2) return false;
        }

        boolean this_present_otherId3 = true;
        boolean that_present_otherId3 = true;
        if (this_present_otherId3 || that_present_otherId3) {
            if (!(this_present_otherId3 && that_present_otherId3)) return false;
            if (this.otherId3 != that.otherId3) return false;
        }

        boolean this_present_someObject = true && this.isSetSomeObject();
        boolean that_present_someObject = true && that.isSetSomeObject();
        if (this_present_someObject || that_present_someObject) {
            if (!(this_present_someObject && that_present_someObject)) return false;
            if (!this.someObject.equals(that.someObject)) return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int hashCode = 1;

        hashCode = hashCode * 8191 + id;

        hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
        if (isSetName()) hashCode = hashCode * 8191 + name.hashCode();

        hashCode = hashCode * 8191 + ((isSetOperationName()) ? 131071 : 524287);
        if (isSetOperationName()) hashCode = hashCode * 8191 + operationName.hashCode();

        hashCode = hashCode * 8191 + ((isSetOperations()) ? 131071 : 524287);
        if (isSetOperations()) hashCode = hashCode * 8191 + operations.hashCode();

        hashCode = hashCode * 8191 + otherId1;

        hashCode = hashCode * 8191 + otherId2;

        hashCode = hashCode * 8191 + otherId3;

        hashCode = hashCode * 8191 + ((isSetSomeObject()) ? 131071 : 524287);
        if (isSetSomeObject()) hashCode = hashCode * 8191 + someObject.hashCode();

        return hashCode;
    }

    @Override
    public int compareTo(MyPojo other) {
        if (!getClass().equals(other.getClass())) {
            return getClass().getName().compareTo(other.getClass().getName());
        }

        int lastComparison = 0;

        lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(other.isSetId());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetId()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetName()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison =
                java.lang.Boolean.valueOf(isSetOperationName())
                        .compareTo(other.isSetOperationName());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetOperationName()) {
            lastComparison =
                    org.apache.thrift.TBaseHelper.compareTo(
                            this.operationName, other.operationName);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison =
                java.lang.Boolean.valueOf(isSetOperations()).compareTo(other.isSetOperations());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetOperations()) {
            lastComparison =
                    org.apache.thrift.TBaseHelper.compareTo(this.operations, other.operations);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison =
                java.lang.Boolean.valueOf(isSetOtherId1()).compareTo(other.isSetOtherId1());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetOtherId1()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otherId1, other.otherId1);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison =
                java.lang.Boolean.valueOf(isSetOtherId2()).compareTo(other.isSetOtherId2());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetOtherId2()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otherId2, other.otherId2);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison =
                java.lang.Boolean.valueOf(isSetOtherId3()).compareTo(other.isSetOtherId3());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetOtherId3()) {
            lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otherId3, other.otherId3);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        lastComparison =
                java.lang.Boolean.valueOf(isSetSomeObject()).compareTo(other.isSetSomeObject());
        if (lastComparison != 0) {
            return lastComparison;
        }
        if (isSetSomeObject()) {
            lastComparison =
                    org.apache.thrift.TBaseHelper.compareTo(this.someObject, other.someObject);
            if (lastComparison != 0) {
                return lastComparison;
            }
        }
        return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
        return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot)
            throws org.apache.thrift.TException {
        scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot)
            throws org.apache.thrift.TException {
        scheme(oprot).write(oprot, this);
    }

    @Override
    public java.lang.String toString() {
        java.lang.StringBuilder sb = new java.lang.StringBuilder("MyPojo(");
        boolean first = true;

        sb.append("id:");
        sb.append(this.id);
        first = false;
        if (!first) sb.append(", ");
        sb.append("name:");
        if (this.name == null) {
            sb.append("null");
        } else {
            sb.append(this.name);
        }
        first = false;
        if (!first) sb.append(", ");
        sb.append("operationName:");
        if (this.operationName == null) {
            sb.append("null");
        } else {
            sb.append(this.operationName);
        }
        first = false;
        if (!first) sb.append(", ");
        sb.append("operations:");
        if (this.operations == null) {
            sb.append("null");
        } else {
            sb.append(this.operations);
        }
        first = false;
        if (!first) sb.append(", ");
        sb.append("otherId1:");
        sb.append(this.otherId1);
        first = false;
        if (!first) sb.append(", ");
        sb.append("otherId2:");
        sb.append(this.otherId2);
        first = false;
        if (!first) sb.append(", ");
        sb.append("otherId3:");
        sb.append(this.otherId3);
        first = false;
        if (isSetSomeObject()) {
            if (!first) sb.append(", ");
            sb.append("someObject:");
            if (this.someObject == null) {
                sb.append("null");
            } else {
                sb.append(this.someObject);
            }
            first = false;
        }
        sb.append(")");
        return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
        // check for required fields
        // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
        try {
            write(
                    new org.apache.thrift.protocol.TCompactProtocol(
                            new org.apache.thrift.transport.TIOStreamTransport(out)));
        } catch (org.apache.thrift.TException te) {
            throw new java.io.IOException(te);
        }
    }

    private void readObject(java.io.ObjectInputStream in)
            throws java.io.IOException, java.lang.ClassNotFoundException {
        try {
            // 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;
            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);
        }
    }

    /**
     * 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"),
        NAME((short) 2, "name"),
        OPERATION_NAME((short) 3, "operationName"),
        OPERATIONS((short) 4, "operations"),
        OTHER_ID1((short) 5, "otherId1"),
        OTHER_ID2((short) 6, "otherId2"),
        OTHER_ID3((short) 7, "otherId3"),
        SOME_OBJECT((short) 8, "someObject");

        private static final java.util.Map<java.lang.String, _Fields> byName =
                new java.util.HashMap<java.lang.String, _Fields>();

        static {
            for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
                byName.put(field.getFieldName(), field);
            }
        }

        private final short _thriftId;
        private final java.lang.String _fieldName;

        _Fields(short thriftId, java.lang.String fieldName) {
            _thriftId = thriftId;
            _fieldName = fieldName;
        }

        /** 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
                    return ID;
                case 2: // NAME
                    return NAME;
                case 3: // OPERATION_NAME
                    return OPERATION_NAME;
                case 4: // OPERATIONS
                    return OPERATIONS;
                case 5: // OTHER_ID1
                    return OTHER_ID1;
                case 6: // OTHER_ID2
                    return OTHER_ID2;
                case 7: // OTHER_ID3
                    return OTHER_ID3;
                case 8: // SOME_OBJECT
                    return SOME_OBJECT;
                default:
                    return null;
            }
        }

        /**
         * Find the _Fields constant that matches fieldId, throwing an exception if it is not found.
         */
        public static _Fields findByThriftIdOrThrow(int fieldId) {
            _Fields fields = findByThriftId(fieldId);
            if (fields == null)
                throw new java.lang.IllegalArgumentException(
                        "Field " + fieldId + " doesn't exist!");
            return fields;
        }

        /** Find the _Fields constant that matches name, or null if its not found. */
        @org.apache.thrift.annotation.Nullable
        public static _Fields findByName(java.lang.String name) {
            return byName.get(name);
        }

        public short getThriftFieldId() {
            return _thriftId;
        }

        public java.lang.String getFieldName() {
            return _fieldName;
        }
    }

    private static class MyPojoStandardSchemeFactory
            implements org.apache.thrift.scheme.SchemeFactory {
        public MyPojoStandardScheme getScheme() {
            return new MyPojoStandardScheme();
        }
    }

    private static class MyPojoStandardScheme
            extends org.apache.thrift.scheme.StandardScheme<MyPojo> {

        public void read(org.apache.thrift.protocol.TProtocol iprot, MyPojo struct)
                throws org.apache.thrift.TException {
            org.apache.thrift.protocol.TField schemeField;
            iprot.readStructBegin();
            while (true) {
                schemeField = iprot.readFieldBegin();
                if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
                    break;
                }
                switch (schemeField.id) {
                    case 1: // ID
                        if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                            struct.id = iprot.readI32();
                            struct.setIdIsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 2: // NAME
                        if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                            struct.name = iprot.readString();
                            struct.setNameIsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 3: // OPERATION_NAME
                        if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                            {
                                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                                struct.operationName =
                                        new java.util.ArrayList<java.lang.String>(_list0.size);
                                @org.apache.thrift.annotation.Nullable java.lang.String _elem1;
                                for (int _i2 = 0; _i2 < _list0.size; ++_i2) {
                                    _elem1 = iprot.readString();
                                    struct.operationName.add(_elem1);
                                }
                                iprot.readListEnd();
                            }
                            struct.setOperationNameIsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 4: // OPERATIONS
                        if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                            {
                                org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                                struct.operations =
                                        new java.util.ArrayList<MyOperation>(_list3.size);
                                @org.apache.thrift.annotation.Nullable MyOperation _elem4;
                                for (int _i5 = 0; _i5 < _list3.size; ++_i5) {
                                    _elem4 = new MyOperation();
                                    _elem4.read(iprot);
                                    struct.operations.add(_elem4);
                                }
                                iprot.readListEnd();
                            }
                            struct.setOperationsIsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 5: // OTHER_ID1
                        if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                            struct.otherId1 = iprot.readI32();
                            struct.setOtherId1IsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 6: // OTHER_ID2
                        if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                            struct.otherId2 = iprot.readI32();
                            struct.setOtherId2IsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 7: // OTHER_ID3
                        if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                            struct.otherId3 = iprot.readI32();
                            struct.setOtherId3IsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    case 8: // SOME_OBJECT
                        if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                            struct.someObject = iprot.readString();
                            struct.setSomeObjectIsSet(true);
                        } else {
                            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                        }
                        break;
                    default:
                        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                }
                iprot.readFieldEnd();
            }
            iprot.readStructEnd();

            // check for required fields of primitive type, which can't be checked in the validate
            // method
            struct.validate();
        }

        public void write(org.apache.thrift.protocol.TProtocol oprot, MyPojo struct)
                throws org.apache.thrift.TException {
            struct.validate();

            oprot.writeStructBegin(STRUCT_DESC);
            oprot.writeFieldBegin(ID_FIELD_DESC);
            oprot.writeI32(struct.id);
            oprot.writeFieldEnd();
            if (struct.name != null) {
                oprot.writeFieldBegin(NAME_FIELD_DESC);
                oprot.writeString(struct.name);
                oprot.writeFieldEnd();
            }
            if (struct.operationName != null) {
                oprot.writeFieldBegin(OPERATION_NAME_FIELD_DESC);
                {
                    oprot.writeListBegin(
                            new org.apache.thrift.protocol.TList(
                                    org.apache.thrift.protocol.TType.STRING,
                                    struct.operationName.size()));
                    for (java.lang.String _iter6 : struct.operationName) {
                        oprot.writeString(_iter6);
                    }
                    oprot.writeListEnd();
                }
                oprot.writeFieldEnd();
            }
            if (struct.operations != null) {
                oprot.writeFieldBegin(OPERATIONS_FIELD_DESC);
                {
                    oprot.writeListBegin(
                            new org.apache.thrift.protocol.TList(
                                    org.apache.thrift.protocol.TType.STRUCT,
                                    struct.operations.size()));
                    for (MyOperation _iter7 : struct.operations) {
                        _iter7.write(oprot);
                    }
                    oprot.writeListEnd();
                }
                oprot.writeFieldEnd();
            }
            oprot.writeFieldBegin(OTHER_ID1_FIELD_DESC);
            oprot.writeI32(struct.otherId1);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(OTHER_ID2_FIELD_DESC);
            oprot.writeI32(struct.otherId2);
            oprot.writeFieldEnd();
            oprot.writeFieldBegin(OTHER_ID3_FIELD_DESC);
            oprot.writeI32(struct.otherId3);
            oprot.writeFieldEnd();
            if (struct.someObject != null) {
                if (struct.isSetSomeObject()) {
                    oprot.writeFieldBegin(SOME_OBJECT_FIELD_DESC);
                    oprot.writeString(struct.someObject);
                    oprot.writeFieldEnd();
                }
            }
            oprot.writeFieldStop();
            oprot.writeStructEnd();
        }
    }

    private static class MyPojoTupleSchemeFactory
            implements org.apache.thrift.scheme.SchemeFactory {
        public MyPojoTupleScheme getScheme() {
            return new MyPojoTupleScheme();
        }
    }

    private static class MyPojoTupleScheme extends org.apache.thrift.scheme.TupleScheme<MyPojo> {

        @Override
        public void write(org.apache.thrift.protocol.TProtocol prot, MyPojo struct)
                throws org.apache.thrift.TException {
            org.apache.thrift.protocol.TTupleProtocol oprot =
                    (org.apache.thrift.protocol.TTupleProtocol) prot;
            java.util.BitSet optionals = new java.util.BitSet();
            if (struct.isSetId()) {
                optionals.set(0);
            }
            if (struct.isSetName()) {
                optionals.set(1);
            }
            if (struct.isSetOperationName()) {
                optionals.set(2);
            }
            if (struct.isSetOperations()) {
                optionals.set(3);
            }
            if (struct.isSetOtherId1()) {
                optionals.set(4);
            }
            if (struct.isSetOtherId2()) {
                optionals.set(5);
            }
            if (struct.isSetOtherId3()) {
                optionals.set(6);
            }
            if (struct.isSetSomeObject()) {
                optionals.set(7);
            }
            oprot.writeBitSet(optionals, 8);
            if (struct.isSetId()) {
                oprot.writeI32(struct.id);
            }
            if (struct.isSetName()) {
                oprot.writeString(struct.name);
            }
            if (struct.isSetOperationName()) {
                {
                    oprot.writeI32(struct.operationName.size());
                    for (java.lang.String _iter8 : struct.operationName) {
                        oprot.writeString(_iter8);
                    }
                }
            }
            if (struct.isSetOperations()) {
                {
                    oprot.writeI32(struct.operations.size());
                    for (MyOperation _iter9 : struct.operations) {
                        _iter9.write(oprot);
                    }
                }
            }
            if (struct.isSetOtherId1()) {
                oprot.writeI32(struct.otherId1);
            }
            if (struct.isSetOtherId2()) {
                oprot.writeI32(struct.otherId2);
            }
            if (struct.isSetOtherId3()) {
                oprot.writeI32(struct.otherId3);
            }
            if (struct.isSetSomeObject()) {
                oprot.writeString(struct.someObject);
            }
        }

        @Override
        public void read(org.apache.thrift.protocol.TProtocol prot, MyPojo struct)
                throws org.apache.thrift.TException {
            org.apache.thrift.protocol.TTupleProtocol iprot =
                    (org.apache.thrift.protocol.TTupleProtocol) prot;
            java.util.BitSet incoming = iprot.readBitSet(8);
            if (incoming.get(0)) {
                struct.id = iprot.readI32();
                struct.setIdIsSet(true);
            }
            if (incoming.get(1)) {
                struct.name = iprot.readString();
                struct.setNameIsSet(true);
            }
            if (incoming.get(2)) {
                {
                    org.apache.thrift.protocol.TList _list10 =
                            new org.apache.thrift.protocol.TList(
                                    org.apache.thrift.protocol.TType.STRING, iprot.readI32());
                    struct.operationName = new java.util.ArrayList<java.lang.String>(_list10.size);
                    @org.apache.thrift.annotation.Nullable java.lang.String _elem11;
                    for (int _i12 = 0; _i12 < _list10.size; ++_i12) {
                        _elem11 = iprot.readString();
                        struct.operationName.add(_elem11);
                    }
                }
                struct.setOperationNameIsSet(true);
            }
            if (incoming.get(3)) {
                {
                    org.apache.thrift.protocol.TList _list13 =
                            new org.apache.thrift.protocol.TList(
                                    org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
                    struct.operations = new java.util.ArrayList<MyOperation>(_list13.size);
                    @org.apache.thrift.annotation.Nullable MyOperation _elem14;
                    for (int _i15 = 0; _i15 < _list13.size; ++_i15) {
                        _elem14 = new MyOperation();
                        _elem14.read(iprot);
                        struct.operations.add(_elem14);
                    }
                }
                struct.setOperationsIsSet(true);
            }
            if (incoming.get(4)) {
                struct.otherId1 = iprot.readI32();
                struct.setOtherId1IsSet(true);
            }
            if (incoming.get(5)) {
                struct.otherId2 = iprot.readI32();
                struct.setOtherId2IsSet(true);
            }
            if (incoming.get(6)) {
                struct.otherId3 = iprot.readI32();
                struct.setOtherId3IsSet(true);
            }
            if (incoming.get(7)) {
                struct.someObject = iprot.readString();
                struct.setSomeObjectIsSet(true);
            }
        }
    }
}
