Exemple #1
0
  @Override
  public int compareTo(DEVICE other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemple #2
0
 /** Performs a deep copy on <i>other</i>. */
 public DEVICE(DEVICE other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetName()) {
     this.name = other.name;
   }
   this.id = other.id;
 }
Exemple #3
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, DEVICE struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetName()) {
     optionals.set(0);
   }
   if (struct.isSetId()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetName()) {
     oprot.writeString(struct.name);
   }
   if (struct.isSetId()) {
     oprot.writeI64(struct.id);
   }
 }
Exemple #4
0
  public boolean equals(DEVICE that) {
    if (that == null) return false;

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name)) return false;
      if (!this.name.equals(that.name)) return false;
    }

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id)) return false;
      if (this.id != that.id) return false;
    }

    return true;
  }