Exemple #1
0
 public TblPriv(TblPriv other) {
   __isset_bit_vector.clear();
   __isset_bit_vector.or(other.__isset_bit_vector);
   if (other.isSetDb()) {
     this.db = other.db;
   }
   if (other.isSetTbl()) {
     this.tbl = other.tbl;
   }
   if (other.isSetUser()) {
     this.user = other.user;
   }
   this.selectPriv = other.selectPriv;
   this.insertPriv = other.insertPriv;
   this.indexPriv = other.indexPriv;
   this.createPriv = other.createPriv;
   this.dropPriv = other.dropPriv;
   this.deletePriv = other.deletePriv;
   this.alterPriv = other.alterPriv;
   this.updatePriv = other.updatePriv;
 }
Exemple #2
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;
  }
Exemple #3
0
  public boolean equals(TblPriv that) {
    if (that == null) return false;

    boolean this_present_db = true && this.isSetDb();
    boolean that_present_db = true && that.isSetDb();
    if (this_present_db || that_present_db) {
      if (!(this_present_db && that_present_db)) return false;
      if (!this.db.equals(that.db)) return false;
    }

    boolean this_present_tbl = true && this.isSetTbl();
    boolean that_present_tbl = true && that.isSetTbl();
    if (this_present_tbl || that_present_tbl) {
      if (!(this_present_tbl && that_present_tbl)) return false;
      if (!this.tbl.equals(that.tbl)) return false;
    }

    boolean this_present_user = true && this.isSetUser();
    boolean that_present_user = true && that.isSetUser();
    if (this_present_user || that_present_user) {
      if (!(this_present_user && that_present_user)) return false;
      if (!this.user.equals(that.user)) return false;
    }

    boolean this_present_selectPriv = true;
    boolean that_present_selectPriv = true;
    if (this_present_selectPriv || that_present_selectPriv) {
      if (!(this_present_selectPriv && that_present_selectPriv)) return false;
      if (this.selectPriv != that.selectPriv) return false;
    }

    boolean this_present_insertPriv = true;
    boolean that_present_insertPriv = true;
    if (this_present_insertPriv || that_present_insertPriv) {
      if (!(this_present_insertPriv && that_present_insertPriv)) return false;
      if (this.insertPriv != that.insertPriv) return false;
    }

    boolean this_present_indexPriv = true;
    boolean that_present_indexPriv = true;
    if (this_present_indexPriv || that_present_indexPriv) {
      if (!(this_present_indexPriv && that_present_indexPriv)) return false;
      if (this.indexPriv != that.indexPriv) return false;
    }

    boolean this_present_createPriv = true;
    boolean that_present_createPriv = true;
    if (this_present_createPriv || that_present_createPriv) {
      if (!(this_present_createPriv && that_present_createPriv)) return false;
      if (this.createPriv != that.createPriv) return false;
    }

    boolean this_present_dropPriv = true;
    boolean that_present_dropPriv = true;
    if (this_present_dropPriv || that_present_dropPriv) {
      if (!(this_present_dropPriv && that_present_dropPriv)) return false;
      if (this.dropPriv != that.dropPriv) return false;
    }

    boolean this_present_deletePriv = true;
    boolean that_present_deletePriv = true;
    if (this_present_deletePriv || that_present_deletePriv) {
      if (!(this_present_deletePriv && that_present_deletePriv)) return false;
      if (this.deletePriv != that.deletePriv) return false;
    }

    boolean this_present_alterPriv = true;
    boolean that_present_alterPriv = true;
    if (this_present_alterPriv || that_present_alterPriv) {
      if (!(this_present_alterPriv && that_present_alterPriv)) return false;
      if (this.alterPriv != that.alterPriv) return false;
    }

    boolean this_present_updatePriv = true;
    boolean that_present_updatePriv = true;
    if (this_present_updatePriv || that_present_updatePriv) {
      if (!(this_present_updatePriv && that_present_updatePriv)) return false;
      if (this.updatePriv != that.updatePriv) return false;
    }

    return true;
  }
Exemple #4
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);
   }
 }