Ejemplo n.º 1
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);
   }
 }
Ejemplo n.º 2
0
 public Offset(OffsetType type, long first, int length) {
   this();
   this.type = type;
   this.first = first;
   setFirstIsSet(true);
   this.length = length;
   setLengthIsSet(true);
 }
Ejemplo n.º 3
0
  @Override
  public void clear() {
    this.type = null;
    setFirstIsSet(false);
    this.first = 0;
    setLengthIsSet(false);
    this.length = 0;
    this.xpath = null;
    this.content_form = "clean_visible";

    this.value = null;
  }
Ejemplo n.º 4
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();
    }
Ejemplo n.º 5
0
 /**
  * actual offset, which could be measured in bytes, chars, or lines. The data element identified
  * by 'first' is included, and that identified by first+length is also included.
  *
  * <p>In set notation, [first:first+length-1]
  *
  * <p>or equivalently [first:first+length)
  *
  * <p>or in list slicing, like python's: [first:first+length]
  *
  * <p>While thrift treats these as signed integers, negative values are meaningless in this
  * context, i.e. we do not end wrap.
  */
 public Offset setFirst(long first) {
   this.first = first;
   setFirstIsSet(true);
   return this;
 }