lttng: Fix Javadoc and formatting in lttng2.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / remote / CommandResult.java
1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote;
13
14 import java.util.Arrays;
15
16 /**
17 * <p>
18 * Class containing command result of remote command execution.
19 * </p>
20 *
21 * @author Bernd Hufmann
22 */
23 public class CommandResult implements ICommandResult {
24
25 // ------------------------------------------------------------------------
26 // Attributes
27 // ------------------------------------------------------------------------
28 /**
29 * The result of the command. 0 if successful else > 0
30 */
31 private int fResult;
32
33 /**
34 * The output as String array.
35 */
36 private String[] fOutput = new String[0];
37
38 // ------------------------------------------------------------------------
39 // Constructor
40 // ------------------------------------------------------------------------
41
42 /**
43 * Constructor
44 *
45 * @param result
46 * The result of the command
47 * @param output
48 * The output, as an array of strings
49 */
50 public CommandResult(int result, String[] output) {
51 fResult = result;
52 if (output != null) {
53 fOutput = Arrays.copyOf(output, output.length);
54 }
55 }
56
57 // ------------------------------------------------------------------------
58 // Accessors
59 // ------------------------------------------------------------------------
60 /*
61 * (non-Javadoc)
62 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandResult#getResult()
63 */
64 @Override
65 public int getResult() {
66 return fResult;
67 }
68
69 /*
70 * (non-Javadoc)
71 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandResult#setResult(int)
72 */
73 @Override
74 public void setResult(int result) {
75 fResult = result;
76 }
77
78 /*
79 * (non-Javadoc)
80 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandResult#getOutput()
81 */
82 @Override
83 public String[] getOutput() {
84 return Arrays.copyOf(fOutput, fOutput.length);
85 }
86
87 /*
88 * (non-Javadoc)
89 * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandResult#setOutput(java.lang.String[])
90 */
91 @Override
92 public void setOutput(String[] output) {
93 fOutput = new String[0];
94 if (output != null) {
95 fOutput = Arrays.copyOf(output, output.length);
96 }
97 }
98 }
This page took 0.034544 seconds and 6 git commands to generate.