@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;
  }