예제 #1
0
파일: Offset.java 프로젝트: joy-xu/KBA2013
 @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);
   }
 }
예제 #2
0
파일: Offset.java 프로젝트: joy-xu/KBA2013
 public Offset(OffsetType type, long first, int length) {
   this();
   this.type = type;
   this.first = first;
   setFirstIsSet(true);
   this.length = length;
   setLengthIsSet(true);
 }
예제 #3
0
파일: Offset.java 프로젝트: joy-xu/KBA2013
  @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;
  }
예제 #4
0
파일: Offset.java 프로젝트: joy-xu/KBA2013
    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();
    }
예제 #5
0
파일: Offset.java 프로젝트: joy-xu/KBA2013
 public Offset setLength(int length) {
   this.length = length;
   setLengthIsSet(true);
   return this;
 }