示例#1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, Offset struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetType()) {
     optionals.set(0);
   }
   if (struct.isSetFirst()) {
     optionals.set(1);
   }
   if (struct.isSetLength()) {
     optionals.set(2);
   }
   if (struct.isSetXpath()) {
     optionals.set(3);
   }
   if (struct.isSetContent_form()) {
     optionals.set(4);
   }
   if (struct.isSetValue()) {
     optionals.set(5);
   }
   oprot.writeBitSet(optionals, 6);
   if (struct.isSetType()) {
     oprot.writeI32(struct.type.getValue());
   }
   if (struct.isSetFirst()) {
     oprot.writeI64(struct.first);
   }
   if (struct.isSetLength()) {
     oprot.writeI32(struct.length);
   }
   if (struct.isSetXpath()) {
     oprot.writeString(struct.xpath);
   }
   if (struct.isSetContent_form()) {
     oprot.writeString(struct.content_form);
   }
   if (struct.isSetValue()) {
     oprot.writeBinary(struct.value);
   }
 }
示例#2
0
  public boolean equals(Offset that) {
    if (that == null) return false;

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type)) return false;
      if (!this.type.equals(that.type)) return false;
    }

    boolean this_present_first = true;
    boolean that_present_first = true;
    if (this_present_first || that_present_first) {
      if (!(this_present_first && that_present_first)) return false;
      if (this.first != that.first) return false;
    }

    boolean this_present_length = true;
    boolean that_present_length = true;
    if (this_present_length || that_present_length) {
      if (!(this_present_length && that_present_length)) return false;
      if (this.length != that.length) return false;
    }

    boolean this_present_xpath = true && this.isSetXpath();
    boolean that_present_xpath = true && that.isSetXpath();
    if (this_present_xpath || that_present_xpath) {
      if (!(this_present_xpath && that_present_xpath)) return false;
      if (!this.xpath.equals(that.xpath)) return false;
    }

    boolean this_present_content_form = true && this.isSetContent_form();
    boolean that_present_content_form = true && that.isSetContent_form();
    if (this_present_content_form || that_present_content_form) {
      if (!(this_present_content_form && that_present_content_form)) return false;
      if (!this.content_form.equals(that.content_form)) return false;
    }

    boolean this_present_value = true && this.isSetValue();
    boolean that_present_value = true && that.isSetValue();
    if (this_present_value || that_present_value) {
      if (!(this_present_value && that_present_value)) return false;
      if (!this.value.equals(that.value)) return false;
    }

    return true;
  }
示例#3
0
 /** Performs a deep copy on <i>other</i>. */
 public Offset(Offset other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetType()) {
     this.type = other.type;
   }
   this.first = other.first;
   this.length = other.length;
   if (other.isSetXpath()) {
     this.xpath = other.xpath;
   }
   if (other.isSetContent_form()) {
     this.content_form = other.content_form;
   }
   if (other.isSetValue()) {
     this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value);
     ;
   }
 }
示例#4
0
  public int compareTo(Offset other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFirst()).compareTo(typedOther.isSetFirst());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFirst()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.first, typedOther.first);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLength()).compareTo(typedOther.isSetLength());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLength()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, typedOther.length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetXpath()).compareTo(typedOther.isSetXpath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetXpath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xpath, typedOther.xpath);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContent_form()).compareTo(typedOther.isSetContent_form());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContent_form()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.content_form, typedOther.content_form);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValue()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }