示例#1
0
文件: Role.java 项目: Leolh/hive
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, Role struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetRoleName()) {
     optionals.set(0);
   }
   if (struct.isSetCreateTime()) {
     optionals.set(1);
   }
   if (struct.isSetOwnerName()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetRoleName()) {
     oprot.writeString(struct.roleName);
   }
   if (struct.isSetCreateTime()) {
     oprot.writeI32(struct.createTime);
   }
   if (struct.isSetOwnerName()) {
     oprot.writeString(struct.ownerName);
   }
 }
示例#2
0
文件: Role.java 项目: Leolh/hive
  @Override
  public int compareTo(Role other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetRoleName()).compareTo(other.isSetRoleName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRoleName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roleName, other.roleName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOwnerName()).compareTo(other.isSetOwnerName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwnerName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerName, other.ownerName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }