Package tv.hd3g.processlauncher.cmdline
Class SimpleParameters
java.lang.Object
tv.hd3g.processlauncher.cmdline.SimpleParameters
- Direct Known Subclasses:
Parameters
-
Field Summary
FieldsModifier and TypeFieldDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllFrom(SimpleParameters source) Don't touch to actual parameters, and clone from source.addBulkParameters(String params) addParameters(String... params) addParameters(Collection<String> params) booleanalterParameter(String parameterKey, String newValue, int paramAsThisKeyPos) clear()voidcompareAndAlter(SimpleParameters toCompare, ArgValueChoice argValueChoice, boolean removeActualMissing, boolean addComparedMissing) protected StringconformParameterKey(String parameterKey) intcount()booleanexportToExternalCommandLine(String processExecFile) Mostly in Linux/Bash mode.inthashCode()booleanhasParameters(String... params) ifHasNotParameter(Runnable toDoIfMissing, String... inParameters) See SimpleParameters#hasParameters()importParametersFrom(SimpleParameters previousInstance) Transfer (clone) current parameters and parameterKeysStartsWithbooleanisEmpty()prependBulkParameters(String params) prependParameters(String... params) prependParameters(Collection<String> params) booleanremoveParameter(String parametersKey, int paramAsThisKeyPos) Search a remove all parameters with paramKey as name, even associated values.replaceParameters(Collection<? extends String> newParameters) setParametersKeysStartsWith(String parameterKeysStartsWith) toString()transfertThisConfigurationTo(SimpleParameters newInstance) Don't touch to current parameters, only parameterKeysStartsWith
-
Field Details
-
MUST_ESCAPE
-
MUST_SURROUND_QUOTE
-
-
Method Details
-
transfertThisConfigurationTo
Don't touch to current parameters, only parameterKeysStartsWith -
importParametersFrom
Transfer (clone) current parameters and parameterKeysStartsWith -
addAllFrom
Don't touch to actual parameters, and clone from source. -
clear
-
hasParameters
- Parameters:
params- (anyMatch) ; params can have "-" or not (it will be added).
-
ifHasNotParameter
See SimpleParameters#hasParameters() -
getParameters
- Returns:
- internal list, never null
-
replaceParameters
-
addParameters
- Parameters:
params- don't alter params Remove null and empty
-
addParameters
- Parameters:
params- don't alter params Remove null and empty
-
addBulkParameters
- Parameters:
params- transform spaces in each param to new params: "a b c d" -> ["a", "b", "c", "d"], and it manage " but not tabs. Remove empty
-
prependParameters
- Parameters:
params- don't alter params
-
prependParameters
- Parameters:
params- add all in front of command line, don't alter params
-
prependBulkParameters
- Parameters:
params- params add all in front of command line, transform spaces in each param to new params: "a b c d" -> ["a", "b", "c", "d"], and it manage " but not tabs.
-
toString
-
exportToExternalCommandLine
Mostly in Linux/Bash mode.- Returns:
- with automatic escape
-
setParametersKeysStartsWith
- Parameters:
parameterKeysStartsWith- "-" by default
-
getParametersKeysStartsWith
- Returns:
- "-" by default
-
conformParameterKey
- Parameters:
parameterKey- add "-" in front of paramKey if needed
-
getValues
- Parameters:
parameterKey- can have "-" or not (it will be added).- Returns:
- For "-param val1 -param val2 -param val3" -> val1, val2, val3 ; null if parameterKey can't be found, empty if not values for param
-
removeParameter
Search a remove all parameters with paramKey as name, even associated values.- Parameters:
parametersKey- can have "-" or not (it will be added).
-
alterParameter
- Parameters:
parameterKey- can have "-" or not (it will be added).- Returns:
- true if done
-
count
public int count() -
isEmpty
public boolean isEmpty() -
getAllArgKeyValues
-
compareAndAlter
public void compareAndAlter(SimpleParameters toCompare, ArgValueChoice argValueChoice, boolean removeActualMissing, boolean addComparedMissing) - Parameters:
argValueChoice- policy to apply if some args keys a in common with actual and toCompareremoveActualMissing- remove all current args not founded in toCompare args listaddComparedMissing- add all args from toCompare args list for some not found in actual args list- See Also:
-
hashCode
public int hashCode() -
equals
-