Esempio n. 1
0
  public int compareTo(TblPriv other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TblPriv typedOther = (TblPriv) other;

    lastComparison = Boolean.valueOf(isSetDb()).compareTo(typedOther.isSetDb());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDb()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db, typedOther.db);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTbl()).compareTo(typedOther.isSetTbl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTbl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tbl, typedOther.tbl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUser()).compareTo(typedOther.isSetUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, typedOther.user);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSelectPriv()).compareTo(typedOther.isSetSelectPriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSelectPriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.selectPriv, typedOther.selectPriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInsertPriv()).compareTo(typedOther.isSetInsertPriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInsertPriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.insertPriv, typedOther.insertPriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIndexPriv()).compareTo(typedOther.isSetIndexPriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIndexPriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.indexPriv, typedOther.indexPriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreatePriv()).compareTo(typedOther.isSetCreatePriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreatePriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.createPriv, typedOther.createPriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDropPriv()).compareTo(typedOther.isSetDropPriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDropPriv()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dropPriv, typedOther.dropPriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDeletePriv()).compareTo(typedOther.isSetDeletePriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeletePriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.deletePriv, typedOther.deletePriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAlterPriv()).compareTo(typedOther.isSetAlterPriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAlterPriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.alterPriv, typedOther.alterPriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUpdatePriv()).compareTo(typedOther.isSetUpdatePriv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUpdatePriv()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.updatePriv, typedOther.updatePriv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 2
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TblPriv struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetDb()) {
     optionals.set(0);
   }
   if (struct.isSetTbl()) {
     optionals.set(1);
   }
   if (struct.isSetUser()) {
     optionals.set(2);
   }
   if (struct.isSetSelectPriv()) {
     optionals.set(3);
   }
   if (struct.isSetInsertPriv()) {
     optionals.set(4);
   }
   if (struct.isSetIndexPriv()) {
     optionals.set(5);
   }
   if (struct.isSetCreatePriv()) {
     optionals.set(6);
   }
   if (struct.isSetDropPriv()) {
     optionals.set(7);
   }
   if (struct.isSetDeletePriv()) {
     optionals.set(8);
   }
   if (struct.isSetAlterPriv()) {
     optionals.set(9);
   }
   if (struct.isSetUpdatePriv()) {
     optionals.set(10);
   }
   oprot.writeBitSet(optionals, 11);
   if (struct.isSetDb()) {
     oprot.writeString(struct.db);
   }
   if (struct.isSetTbl()) {
     oprot.writeString(struct.tbl);
   }
   if (struct.isSetUser()) {
     oprot.writeString(struct.user);
   }
   if (struct.isSetSelectPriv()) {
     oprot.writeBool(struct.selectPriv);
   }
   if (struct.isSetInsertPriv()) {
     oprot.writeBool(struct.insertPriv);
   }
   if (struct.isSetIndexPriv()) {
     oprot.writeBool(struct.indexPriv);
   }
   if (struct.isSetCreatePriv()) {
     oprot.writeBool(struct.createPriv);
   }
   if (struct.isSetDropPriv()) {
     oprot.writeBool(struct.dropPriv);
   }
   if (struct.isSetDeletePriv()) {
     oprot.writeBool(struct.deletePriv);
   }
   if (struct.isSetAlterPriv()) {
     oprot.writeBool(struct.alterPriv);
   }
   if (struct.isSetUpdatePriv()) {
     oprot.writeBool(struct.updatePriv);
   }
 }