public final class ParametersList
extends java.lang.Object
implements java.lang.Cloneable
-D<name>=<value>
)Constructor and Description |
---|
ParametersList() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String parameter) |
void |
add(java.lang.String name,
java.lang.String value) |
void |
addAll(java.util.List<java.lang.String> parameters) |
void |
addAll(java.lang.String... parameters) |
void |
addAt(int index,
java.lang.String parameter) |
void |
addNotEmptyProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Adds
-D<propertyName>=<propertyValue> to the list ignoring null, empty and spaces-only values;
replaces the value of the last property if defined. |
void |
addParametersString(java.lang.String parameters) |
ParamsGroup |
addParamsGroup(ParamsGroup group) |
ParamsGroup |
addParamsGroup(java.lang.String groupId) |
ParamsGroup |
addParamsGroupAt(int index,
ParamsGroup group) |
ParamsGroup |
addParamsGroupAt(int index,
java.lang.String groupId) |
void |
addProperty(java.lang.String propertyName)
Adds
-D<propertyName> to the list; replaces the value of the last property if defined. |
void |
addProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Adds
-D<propertyName>=<propertyValue> to the list ignoring null values;
replaces the value of the last property if defined. |
void |
clearAll() |
ParametersList |
clone() |
void |
defineProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Keeps the
<propertyName> property if defined; otherwise appends the new one ignoring null values. |
void |
defineSystemProperty(java.lang.String propertyName)
Keeps the
<propertyName> property if defined; or defines it with System.getProperty() as a value if present. |
java.lang.String |
expandMacros(java.lang.String text) |
java.lang.String |
get(int ind) |
java.lang.String [] |
getArray() |
java.lang.String |
getLast() |
java.util.List<java.lang.String> |
getList() |
java.util.List<java.lang.String> |
getParameters() |
java.lang.String |
getParametersString() |
ParamsGroup |
getParamsGroup(java.lang.String name) |
ParamsGroup |
getParamsGroupAt(int index) |
java.util.List<ParamsGroup> |
getParamsGroups() |
int |
getParamsGroupsCount() |
java.util.Map<java.lang.String,java.lang.String> |
getProperties() |
java.util.Map<java.lang.String,java.lang.String> |
getProperties(java.lang.String valueIfMissing) |
java.lang.String |
getPropertyValue(java.lang.String propertyName) |
boolean |
hasParameter(java.lang.String parameter) |
boolean |
hasProperty(java.lang.String propertyName) |
static java.lang.String |
join(java.util.List<java.lang.String> parameters) |
static java.lang.String |
join(java.lang.String... parameters) |
static java.lang.String [] |
parse(java.lang.String string) |
void |
prepend(java.lang.String parameter) |
void |
prependAll(java.lang.String... parameter) |
ParamsGroup |
removeParamsGroup(int index) |
void |
replaceOrAppend(java.lang.String parameterPrefix,
java.lang.String replacement)
Replaces the last parameter that starts with the
<parameterPrefix> with <replacement> ;
otherwise appends <replacement> to the list. |
void |
replaceOrPrepend(java.lang.String parameterPrefix,
java.lang.String replacement)
Replaces the last parameter that starts with the
<parameterPrefix> with <replacement> ;
otherwise prepends this list with <replacement> . |
void |
set(int ind,
java.lang.String value) |
static void |
setTestMacros(java.util.Map<java.lang.String,java.lang.String> testMacros) |
java.lang.String |
toString() |
public boolean hasParameter(java.lang.String parameter)
public boolean hasProperty(java.lang.String propertyName)
public java.lang.String getPropertyValue(java.lang.String propertyName)
public java.util.Map<java.lang.String,java.lang.String> getProperties()
public java.util.Map<java.lang.String,java.lang.String> getProperties(java.lang.String valueIfMissing)
public java.lang.String getParametersString()
public java.lang.String [] getArray()
public java.util.List<java.lang.String> getList()
public void clearAll()
public void prepend(java.lang.String parameter)
public void prependAll(java.lang.String... parameter)
public void addParametersString(java.lang.String parameters)
public void add(java.lang.String parameter)
public ParamsGroup addParamsGroup(java.lang.String groupId)
public ParamsGroup addParamsGroup(ParamsGroup group)
public ParamsGroup addParamsGroupAt(int index, ParamsGroup group)
public ParamsGroup addParamsGroupAt(int index, java.lang.String groupId)
public int getParamsGroupsCount()
public java.util.List<java.lang.String> getParameters()
public java.util.List<ParamsGroup> getParamsGroups()
public ParamsGroup getParamsGroupAt(int index)
public ParamsGroup getParamsGroup(java.lang.String name)
public ParamsGroup removeParamsGroup(int index)
public void addAt(int index, java.lang.String parameter)
public void defineSystemProperty(java.lang.String propertyName)
<propertyName>
property if defined; or defines it with System.getProperty()
as a value if present.public void defineProperty(java.lang.String propertyName, java.lang.String propertyValue)
<propertyName>
property if defined; otherwise appends the new one ignoring null values.public void addProperty(java.lang.String propertyName)
-D<propertyName>
to the list; replaces the value of the last property if defined.public void addProperty(java.lang.String propertyName, java.lang.String propertyValue)
-D<propertyName>=<propertyValue>
to the list ignoring null values;
replaces the value of the last property if defined.public void addNotEmptyProperty(java.lang.String propertyName, java.lang.String propertyValue)
-D<propertyName>=<propertyValue>
to the list ignoring null, empty and spaces-only values;
replaces the value of the last property if defined.public void replaceOrAppend(java.lang.String parameterPrefix, java.lang.String replacement)
<parameterPrefix>
with <replacement>
;
otherwise appends <replacement>
to the list.public void replaceOrPrepend(java.lang.String parameterPrefix, java.lang.String replacement)
<parameterPrefix>
with <replacement>
;
otherwise prepends this list with <replacement>
.public void set(int ind, java.lang.String value)
public java.lang.String get(int ind)
public java.lang.String getLast()
public void add(java.lang.String name, java.lang.String value)
public void addAll(java.lang.String... parameters)
public void addAll(java.util.List<java.lang.String> parameters)
public ParametersList clone()
clone
in class java.lang.Object
public static java.lang.String join(java.util.List<java.lang.String> parameters)
ParametersListUtil.join(List)
public static java.lang.String join(java.lang.String... parameters)
ParametersListUtil.join(List)
public static java.lang.String [] parse(java.lang.String string)
ParametersListUtil.parseToArray(String)
public java.lang.String expandMacros(java.lang.String text)
public static void setTestMacros(java.util.Map<java.lang.String,java.lang.String> testMacros)
public java.lang.String toString()
toString
in class java.lang.Object