public CommandResult deepCopy() { return new CommandResult(this); }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OUTPUT: return getOutput(); case ERROR: return getError(); case EXIT_CODE: return getExitCode(); } throw new java.lang.IllegalStateException(); }
public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case OUTPUT: if (value == null) { unsetOutput(); } else { setOutput((java.lang.String)value); } break; case ERROR: if (value == null) { unsetError(); } else { setError((java.lang.String)value); } break; case EXIT_CODE: if (value == null) { unsetExitCode(); } else { setExitCode((java.lang.Integer)value); } break; } }
/** * Performs a deep copy on <i>other</i>. */ public CommandResult(CommandResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetOutput()) { this.output = other.output; } if (other.isSetError()) { this.error = other.error; } this.exitCode = other.exitCode; }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetOutput()) ? 131071 : 524287); if (isSetOutput()) hashCode = hashCode * 8191 + output.hashCode(); hashCode = hashCode * 8191 + ((isSetError()) ? 131071 : 524287); if (isSetError()) hashCode = hashCode * 8191 + error.hashCode(); hashCode = hashCode * 8191 + ((isSetExitCode()) ? 131071 : 524287); if (isSetExitCode()) hashCode = hashCode * 8191 + exitCode; return hashCode; }
@Override public CommandResult executeCommand(String name, List<String> command) throws TException { try { ExecResult res = new ExecHelper(ToolPaths.getPythonDriversDir()).exec( RedirectType.TO_BUFFER, null, true, command.toArray(new String[0]) ); return new CommandResult().setOutput(res.stdout.toString()) .setError(res.stderr.toString()) .setExitCode(res.res); } catch (Exception ex) { throw new TException(ex); } }
public void write(org.apache.thrift.protocol.TProtocol oprot, CommandResult struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.output != null) { if (struct.isSetOutput()) { oprot.writeFieldBegin(OUTPUT_FIELD_DESC); oprot.writeString(struct.output); oprot.writeFieldEnd(); } } if (struct.error != null) { if (struct.isSetError()) { oprot.writeFieldBegin(ERROR_FIELD_DESC); oprot.writeString(struct.error); oprot.writeFieldEnd(); } } if (struct.isSetExitCode()) { oprot.writeFieldBegin(EXIT_CODE_FIELD_DESC); oprot.writeI32(struct.exitCode); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, executeCommand_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new CommandResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CommandResult) return this.equals((CommandResult)that); return false; }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); return hashCode; }
/** 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 java.lang.IllegalArgumentException(); } switch (field) { case OUTPUT: return isSetOutput(); case ERROR: return isSetError(); case EXIT_CODE: return isSetExitCode(); } throw new java.lang.IllegalStateException(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, executeCommand_result 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 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new CommandResult(); struct.success.read(iprot); struct.setSuccessIsSet(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 boolean equals(executeCommand_result that) { if (that == null) return false; if (this == that) return true; 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; } return true; }
switch (commandResult.getExitCode()) { case 0: commandResult.getOutput(), "</textarea>"); break; Integer.toString(commandResult.getExitCode()), "</p>", "<textarea readonly rows='25' cols='160'>\n", commandResult.getError(), "</textarea>");
return true; boolean this_present_output = true && this.isSetOutput(); boolean that_present_output = true && that.isSetOutput(); if (this_present_output || that_present_output) { if (!(this_present_output && that_present_output)) 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)) boolean this_present_exitCode = true && this.isSetExitCode(); boolean that_present_exitCode = true && that.isSetExitCode(); if (this_present_exitCode || that_present_exitCode) { if (!(this_present_exitCode && that_present_exitCode))
/** * Performs a deep copy on <i>other</i>. */ public executeCommand_result(executeCommand_result other) { if (other.isSetSuccess()) { this.success = new CommandResult(other.success); } }
lastComparison = java.lang.Boolean.valueOf(isSetOutput()).compareTo(other.isSetOutput()); if (lastComparison != 0) { return lastComparison; if (isSetOutput()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.output, other.output); if (lastComparison != 0) { lastComparison = java.lang.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) { lastComparison = java.lang.Boolean.valueOf(isSetExitCode()).compareTo(other.isSetExitCode()); if (lastComparison != 0) { return lastComparison; if (isSetExitCode()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exitCode, other.exitCode); if (lastComparison != 0) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, CommandResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOutput()) { optionals.set(0); } if (struct.isSetError()) { optionals.set(1); } if (struct.isSetExitCode()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetOutput()) { oprot.writeString(struct.output); } if (struct.isSetError()) { oprot.writeString(struct.error); } if (struct.isSetExitCode()) { oprot.writeI32(struct.exitCode); } }
boolean first = true; if (isSetOutput()) { sb.append("output:"); if (this.output == null) { if (isSetError()) { if (!first) sb.append(", "); sb.append("error:"); if (isSetExitCode()) { if (!first) sb.append(", "); sb.append("exitCode:");