Пример #1
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;
  }
Пример #2
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);
     ;
   }
 }
Пример #3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, Offset struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(struct.type.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(FIRST_FIELD_DESC);
      oprot.writeI64(struct.first);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(LENGTH_FIELD_DESC);
      oprot.writeI32(struct.length);
      oprot.writeFieldEnd();
      if (struct.xpath != null) {
        if (struct.isSetXpath()) {
          oprot.writeFieldBegin(XPATH_FIELD_DESC);
          oprot.writeString(struct.xpath);
          oprot.writeFieldEnd();
        }
      }
      if (struct.content_form != null) {
        if (struct.isSetContent_form()) {
          oprot.writeFieldBegin(CONTENT_FORM_FIELD_DESC);
          oprot.writeString(struct.content_form);
          oprot.writeFieldEnd();
        }
      }
      if (struct.value != null) {
        if (struct.isSetValue()) {
          oprot.writeFieldBegin(VALUE_FIELD_DESC);
          oprot.writeBinary(struct.value);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Пример #4
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);
   }
 }
Пример #5
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, Offset struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = OffsetType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FIRST
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.first = iprot.readI64();
              struct.setFirstIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.length = iprot.readI32();
              struct.setLengthIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // XPATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.xpath = iprot.readString();
              struct.setXpathIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CONTENT_FORM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.content_form = iprot.readString();
              struct.setContent_formIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.value = iprot.readBinary();
              struct.setValueIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
Пример #6
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;
  }
Пример #7
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, Offset struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.type = OffsetType.findByValue(iprot.readI32());
     struct.setTypeIsSet(true);
   }
   if (incoming.get(1)) {
     struct.first = iprot.readI64();
     struct.setFirstIsSet(true);
   }
   if (incoming.get(2)) {
     struct.length = iprot.readI32();
     struct.setLengthIsSet(true);
   }
   if (incoming.get(3)) {
     struct.xpath = iprot.readString();
     struct.setXpathIsSet(true);
   }
   if (incoming.get(4)) {
     struct.content_form = iprot.readString();
     struct.setContent_formIsSet(true);
   }
   if (incoming.get(5)) {
     struct.value = iprot.readBinary();
     struct.setValueIsSet(true);
   }
 }