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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetPredicateName()).compareTo(other.isSetPredicateName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPredicateName()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.predicateName, other.predicateName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValues()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
 /** Performs a deep copy on <i>other</i>. */
 public UnaryPredicate(UnaryPredicate other) {
   if (other.isSetPredicateName()) {
     this.predicateName = other.predicateName;
   }
   if (other.isSetValues()) {
     List<PredicateValue> __this__values = new ArrayList<PredicateValue>(other.values.size());
     for (PredicateValue other_element : other.values) {
       __this__values.add(new PredicateValue(other_element));
     }
     this.values = __this__values;
   }
 }
    public void write(org.apache.thrift.protocol.TProtocol oprot, UnaryPredicate struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.predicateName != null) {
        oprot.writeFieldBegin(PREDICATE_NAME_FIELD_DESC);
        oprot.writeString(struct.predicateName);
        oprot.writeFieldEnd();
      }
      if (struct.values != null) {
        oprot.writeFieldBegin(VALUES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.values.size()));
          for (PredicateValue _iter3 : struct.values) {
            _iter3.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    public void read(org.apache.thrift.protocol.TProtocol iprot, UnaryPredicate 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: // PREDICATE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.predicateName = iprot.readString();
              struct.setPredicateNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.values = new ArrayList<PredicateValue>(_list0.size);
                for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
                  PredicateValue _elem2;
                  _elem2 = new PredicateValue();
                  _elem2.read(iprot);
                  struct.values.add(_elem2);
                }
                iprot.readListEnd();
              }
              struct.setValuesIsSet(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 boolean equals(UnaryPredicate that) {
    if (that == null) return false;

    boolean this_present_predicateName = true && this.isSetPredicateName();
    boolean that_present_predicateName = true && that.isSetPredicateName();
    if (this_present_predicateName || that_present_predicateName) {
      if (!(this_present_predicateName && that_present_predicateName)) return false;
      if (!this.predicateName.equals(that.predicateName)) return false;
    }

    boolean this_present_values = true && this.isSetValues();
    boolean that_present_values = true && that.isSetValues();
    if (this_present_values || that_present_values) {
      if (!(this_present_values && that_present_values)) return false;
      if (!this.values.equals(that.values)) return false;
    }

    return true;
  }
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, UnaryPredicate struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.predicateName = iprot.readString();
   struct.setPredicateNameIsSet(true);
   {
     org.apache.thrift.protocol.TList _list5 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.values = new ArrayList<PredicateValue>(_list5.size);
     for (int _i6 = 0; _i6 < _list5.size; ++_i6) {
       PredicateValue _elem7;
       _elem7 = new PredicateValue();
       _elem7.read(iprot);
       struct.values.add(_elem7);
     }
   }
   struct.setValuesIsSet(true);
 }