@Override public int compareTo(FSError 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(isSetErrorMsg()).compareTo(other.isSetErrorMsg()); if (lastComparison != 0) { return lastComparison; } if (isSetErrorMsg()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMsg, other.errorMsg); if (lastComparison != 0) { return lastComparison; } } return 0; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, FSError struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.errorCode = iprot.readI32(); struct.setErrorCodeIsSet(true); } if (incoming.get(1)) { struct.errorMsg = iprot.readString(); struct.setErrorMsgIsSet(true); } }
/** Performs a deep copy on <i>other</i>. */ public FSError(FSError other) { __isset_bitfield = other.__isset_bitfield; this.errorCode = other.errorCode; if (other.isSetErrorMsg()) { this.errorMsg = other.errorMsg; } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, FSError struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetErrorCode()) { optionals.set(0); } if (struct.isSetErrorMsg()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetErrorCode()) { oprot.writeI32(struct.errorCode); } if (struct.isSetErrorMsg()) { oprot.writeString(struct.errorMsg); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, FSError 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: // ERROR_CODE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.errorCode = iprot.readI32(); struct.setErrorCodeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // ERROR_MSG if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.errorMsg = iprot.readString(); struct.setErrorMsgIsSet(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(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, FSError struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); oprot.writeI32(struct.errorCode); oprot.writeFieldEnd(); if (struct.errorMsg != null) { oprot.writeFieldBegin(ERROR_MSG_FIELD_DESC); oprot.writeString(struct.errorMsg); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public boolean equals(FSError that) { if (that == null) return false; boolean this_present_errorCode = true; boolean that_present_errorCode = true; if (this_present_errorCode || that_present_errorCode) { if (!(this_present_errorCode && that_present_errorCode)) return false; if (this.errorCode != that.errorCode) return false; } boolean this_present_errorMsg = true && this.isSetErrorMsg(); boolean that_present_errorMsg = true && that.isSetErrorMsg(); if (this_present_errorMsg || that_present_errorMsg) { if (!(this_present_errorMsg && that_present_errorMsg)) return false; if (!this.errorMsg.equals(that.errorMsg)) return false; } return true; }