Exemplo n.º 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, OnlineStatus struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetName()) {
     optionals.set(0);
   }
   if (struct.isSetPlugin()) {
     optionals.set(1);
   }
   if (struct.isSetPackagename()) {
     optionals.set(2);
   }
   if (struct.isSetStatus()) {
     optionals.set(3);
   }
   if (struct.isSetSize()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetName()) {
     oprot.writeString(struct.name);
   }
   if (struct.isSetPlugin()) {
     oprot.writeString(struct.plugin);
   }
   if (struct.isSetPackagename()) {
     oprot.writeString(struct.packagename);
   }
   if (struct.isSetStatus()) {
     oprot.writeI32(struct.status.getValue());
   }
   if (struct.isSetSize()) {
     oprot.writeI64(struct.size);
   }
 }
Exemplo n.º 2
0
  public int compareTo(OnlineStatus other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    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(isSetPlugin()).compareTo(typedOther.isSetPlugin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPlugin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.plugin, typedOther.plugin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPackagename()).compareTo(typedOther.isSetPackagename());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPackagename()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.packagename, typedOther.packagename);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSize()).compareTo(typedOther.isSetSize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSize()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, typedOther.size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }