public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case ERROR: return getError(); } throw new IllegalStateException(); }
@Override public int compareTo(getPreferredServer_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError()); if (lastComparison != 0) { return lastComparison; } if (isSetError()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error); if (lastComparison != 0) { return lastComparison; } } return 0; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
struct.success = new HostAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.error = new GFXDException(); struct.error.read(iprot); struct.setErrorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
public boolean equals(getPreferredServer_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_error = true && this.isSetError(); boolean that_present_error = true && that.isSetError(); if (this_present_error || that_present_error) { if (!(this_present_error && that_present_error)) return false; if (!this.error.equals(that.error)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetError()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetError()) { struct.error.write(oprot); } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((HostAddress)value); } break; case ERROR: if (value == null) { unsetError(); } else { setError((GFXDException)value); } break; } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new HostAddress(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.error = new GFXDException(); struct.error.read(iprot); struct.setErrorIsSet(true); } } }
public getPreferredServer_result deepCopy() { return new getPreferredServer_result(this); }
/** 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 SUCCESS: return isSetSuccess(); case ERROR: return isSetError(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getPreferredServer_result) return this.equals((getPreferredServer_result)that); return false; }
public getPreferredServer_result getResult(I iface, getPreferredServer_args args) throws org.apache.thrift.TException { getPreferredServer_result result = new getPreferredServer_result(); try { result.success = iface.getPreferredServer(args.serverTypes, args.serverGroups, args.failedServers); } catch (GFXDException error) { result.error = error; } return result; } }
public HostAddress recv_getPreferredServer() throws GFXDException, org.apache.thrift.TException { getPreferredServer_result result = new getPreferredServer_result(); receiveBase(result, "getPreferredServer"); if (result.isSetSuccess()) { return result.success; } if (result.error != null) { throw result.error; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPreferredServer failed: unknown result"); }
/** * Performs a deep copy on <i>other</i>. */ public getPreferredServer_result(getPreferredServer_result other) { if (other.isSetSuccess()) { this.success = new HostAddress(other.success); } if (other.isSetError()) { this.error = new GFXDException(other.error); } }