public CommandResult deepCopy() { return new CommandResult(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof CommandResult) return this.equals((CommandResult)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); case MESSAGE: return getMessage(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public CommandResult(CommandResult other) { if (other.isSetStatus()) { this.status = other.status; } if (other.isSetMessage()) { this.message = other.message; } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { unsetStatus(); } else { setStatus((CommandStatus)value); } break; case MESSAGE: if (value == null) { unsetMessage(); } else { setMessage((String)value); } break; } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, executeCommand_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new CommandResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.cliException = new CliThriftException(); struct.cliException.read(iprot); struct.setCliExceptionIsSet(true); } } }
if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.status = org.kaaproject.kaa.server.common.thrift.gen.cli.CommandStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.message = iprot.readString(); struct.setMessageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CommandResult struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.status = org.kaaproject.kaa.server.common.thrift.gen.cli.CommandStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); } if (incoming.get(1)) { struct.message = iprot.readString(); struct.setMessageIsSet(true); } } }
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); } }
/** 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 STATUS: return isSetStatus(); case MESSAGE: return isSetMessage(); } throw new IllegalStateException(); }
case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new CommandResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else {
public boolean equals(CommandResult that) { if (that == null) return false; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); if (this_present_status || that_present_status) { if (!(this_present_status && that_present_status)) return false; if (!this.status.equals(that.status)) return false; } boolean this_present_message = true && this.isSetMessage(); boolean that_present_message = true && that.isSetMessage(); if (this_present_message || that_present_message) { if (!(this_present_message && that_present_message)) return false; if (!this.message.equals(that.message)) return false; } return true; }
CommandResult result = new CommandResult(); writer.println(); writer.flush();
public boolean equals(executeCommand_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_cliException = true && this.isSetCliException(); boolean that_present_cliException = true && that.isSetCliException(); if (this_present_cliException || that_present_cliException) { if (!(this_present_cliException && that_present_cliException)) return false; if (!this.cliException.equals(that.cliException)) return false; } return true; }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_status = true && (isSetStatus()); list.add(present_status); if (present_status) list.add(status.getValue()); boolean present_message = true && (isSetMessage()); list.add(present_message); if (present_message) list.add(message); return list.hashCode(); }
/** * Performs a deep copy on <i>other</i>. */ public executeCommand_result(executeCommand_result other) { if (other.isSetSuccess()) { this.success = new CommandResult(other.success); } if (other.isSetCliException()) { this.cliException = new CliThriftException(other.cliException); } }
@Override public int compareTo(CommandResult other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } if (isSetStatus()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); 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, CommandResult struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetStatus()) { optionals.set(0); } if (struct.isSetMessage()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetStatus()) { oprot.writeI32(struct.status.getValue()); } if (struct.isSetMessage()) { oprot.writeString(struct.message); } }