Class SystemCommand
- java.lang.Object
-
- com.github.toolarium.system.command.dto.SystemCommand
-
- All Implemented Interfaces:
ISystemCommand
public class SystemCommand extends java.lang.Object implements ISystemCommand
Implements theISystemCommand.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.toolarium.system.command.dto.ISystemCommand
ISystemCommand.SystemCommandExecutionStatusResult
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSPACESPACE
-
Constructor Summary
Constructors Constructor Description SystemCommand()Constructor for SystemCommandSystemCommand(IProcessEnvironment processEnvironment)Constructor for SystemCommand
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String command)Add an additional part of the commandvoidadd(java.lang.String command, java.lang.String displayCommand)Add an additional part of the commandbooleanequals(java.lang.Object obj)java.util.List<java.lang.String>getCommandList()The system command list which will be passed in the exact way to the system command.IProcessEnvironmentgetProcessEnvironment()Get the process environmentjava.util.List<java.lang.String>getShell()The shell to execute.ISystemCommand.SystemCommandExecutionStatusResultgetSystemCommandExecutionStatusResult()Get the system command execution status resultinthashCode()protected voidsetCommandList(java.util.List<java.lang.String> commandList)Set the command listvoidsetShell(java.util.List<java.lang.String> shell)Set the shellvoidsetSystemCommandExecutionStatusResult(ISystemCommand.SystemCommandExecutionStatusResult systemCommandExecutionStatusResult)Set the system command execution status resultjava.lang.StringtoString()java.lang.StringtoString(boolean forDisplay)The command as string
-
-
-
Field Detail
-
SPACE
public static final java.lang.String SPACE
SPACE- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SystemCommand
public SystemCommand()
Constructor for SystemCommand
-
SystemCommand
public SystemCommand(IProcessEnvironment processEnvironment)
Constructor for SystemCommand- Parameters:
processEnvironment- the process environment
-
-
Method Detail
-
getProcessEnvironment
public IProcessEnvironment getProcessEnvironment()
Description copied from interface:ISystemCommandGet the process environment- Specified by:
getProcessEnvironmentin interfaceISystemCommand- Returns:
- the process environment
- See Also:
ISystemCommand.getProcessEnvironment()
-
getShell
public java.util.List<java.lang.String> getShell()
Description copied from interface:ISystemCommandThe shell to execute.- Specified by:
getShellin interfaceISystemCommand- Returns:
- the shell to use, by default null.
- See Also:
ISystemCommand.getShell()
-
setShell
public void setShell(java.util.List<java.lang.String> shell)
Set the shell- Parameters:
shell- the shell
-
getCommandList
public java.util.List<java.lang.String> getCommandList()
Description copied from interface:ISystemCommandThe system command list which will be passed in the exact way to the system command.- Specified by:
getCommandListin interfaceISystemCommand- Returns:
- the command list
- See Also:
ISystemCommand.getCommandList()
-
add
public void add(java.lang.String command)
Add an additional part of the command- Parameters:
command- the additional part of the command
-
add
public void add(java.lang.String command, java.lang.String displayCommand)Add an additional part of the command- Parameters:
command- the additional part of the commanddisplayCommand- the additional part of the command to display
-
setCommandList
protected void setCommandList(java.util.List<java.lang.String> commandList)
Set the command list- Parameters:
commandList- the command list
-
getSystemCommandExecutionStatusResult
public ISystemCommand.SystemCommandExecutionStatusResult getSystemCommandExecutionStatusResult()
Description copied from interface:ISystemCommandGet the system command execution status result- Specified by:
getSystemCommandExecutionStatusResultin interfaceISystemCommand- Returns:
- the system command execution status result
- See Also:
ISystemCommand.getSystemCommandExecutionStatusResult()
-
setSystemCommandExecutionStatusResult
public void setSystemCommandExecutionStatusResult(ISystemCommand.SystemCommandExecutionStatusResult systemCommandExecutionStatusResult)
Set the system command execution status result- Parameters:
systemCommandExecutionStatusResult- the system command execution status result
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
ISystemCommand.toString(boolean)
-
toString
public java.lang.String toString(boolean forDisplay)
Description copied from interface:ISystemCommandThe command as string- Specified by:
toStringin interfaceISystemCommand- Parameters:
forDisplay- true to prepare the arguments for display; otherwise false. This can be used to protect security relevant arguments e.g. java properties with a password- Returns:
- the arguments as string
- See Also:
ISystemCommand.toString(boolean)
-
-