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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSPACESPACE
-
Constructor Summary
Constructors Constructor Description SystemCommand()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.java.util.List<java.lang.String>getShell()The shell to execute.inthashCode()voidsetCommandList(java.util.List<java.lang.String> commandList)Set the command listvoidsetShell(java.util.List<java.lang.String> shell)Set the shelljava.lang.StringtoString(boolean forDisplay)The command as string
-
-
-
Field Detail
-
SPACE
public static final java.lang.String SPACE
SPACE- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void setCommandList(java.util.List<java.lang.String> commandList)
Set the command list- Parameters:
commandList- the command list
-
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(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)
-
-