/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case ERROR_CODE: return isSetErrorCode(); case MESSAGE: return isSetMessage(); } throw new IllegalStateException(); }
@Override public int compareTo(CliThriftException other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); if (lastComparison != 0) { return lastComparison; } if (isSetErrorCode()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } if (isSetMessage()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); if (lastComparison != 0) { return lastComparison; } } return 0; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, CliThriftException struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetErrorCode()) { optionals.set(0); } if (struct.isSetMessage()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetErrorCode()) { oprot.writeI32(struct.errorCode); } if (struct.isSetMessage()) { oprot.writeString(struct.message); } }