Ejemplo n.º 1
0
  public int compareTo(ClientRawTableInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPath()).compareTo(typedOther.isSetPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, typedOther.path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumns()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMetadata()).compareTo(typedOther.isSetMetadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, typedOther.metadata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Ejemplo n.º 2
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ClientRawTableInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetId()) {
     optionals.set(0);
   }
   if (struct.isSetName()) {
     optionals.set(1);
   }
   if (struct.isSetPath()) {
     optionals.set(2);
   }
   if (struct.isSetColumns()) {
     optionals.set(3);
   }
   if (struct.isSetMetadata()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetId()) {
     oprot.writeI32(struct.id);
   }
   if (struct.isSetName()) {
     oprot.writeString(struct.name);
   }
   if (struct.isSetPath()) {
     oprot.writeString(struct.path);
   }
   if (struct.isSetColumns()) {
     oprot.writeI32(struct.columns);
   }
   if (struct.isSetMetadata()) {
     oprot.writeBinary(struct.metadata);
   }
 }