@Override public void write(org.apache.thrift.protocol.TProtocol prot, MentionEntity struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetId()) { optionals.set(0); } if (struct.isSetName()) { optionals.set(1); } if (struct.isSetScreen_name()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetId()) { oprot.writeI64(struct.id); } if (struct.isSetName()) { oprot.writeString(struct.name); } if (struct.isSetScreen_name()) { oprot.writeString(struct.screen_name); } }
@Override public int compareTo(MentionEntity other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); if (lastComparison != 0) { return lastComparison; } if (isSetName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetScreen_name()).compareTo(other.isSetScreen_name()); if (lastComparison != 0) { return lastComparison; } if (isSetScreen_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.screen_name, other.screen_name); if (lastComparison != 0) { return lastComparison; } } return 0; }