@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); } }
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; }