@NotThreadSafe public class PSXPathVariables extends Object implements IPSXPathVariables
Constructor and Description |
---|
PSXPathVariables() |
PSXPathVariables(IPSXPathVariables aOther) |
Modifier and Type | Method and Description |
---|---|
com.helger.commons.state.EChange |
add(Map.Entry<String,String> aEntry)
Add a new variable.
|
com.helger.commons.state.EChange |
add(String sName,
String sValue)
Add a new variable.
|
boolean |
contains(String sName) |
String |
get(String sName) |
com.helger.commons.collection.ext.ICommonsNavigableMap<String,String> |
getAll() |
String |
getAppliedReplacement(String sText)
Perform the text replacement of all variables in the specified text.
|
PSXPathVariables |
getClone() |
com.helger.commons.state.EChange |
remove(String sVarName)
Remove the variable with the specified name
|
com.helger.commons.state.EChange |
removeAll(Iterable<String> aVars)
Remove all variables with the specified names
|
String |
toString() |
public PSXPathVariables()
public PSXPathVariables(@Nonnull IPSXPathVariables aOther)
@Nonnull public com.helger.commons.state.EChange add(@Nonnull Map.Entry<String,String> aEntry)
aEntry
- The entry to be added - key is the variable name and value is the
variable value. May not be null
.EChange.UNCHANGED
if a variable with the same name is
already present. Never null
.@Nonnull public com.helger.commons.state.EChange add(@Nonnull @Nonempty String sName, @Nonnull @Nonempty String sValue)
sName
- The name of the variable. May neither be null
nor
empty.sValue
- The value of the variable. May neither be null
nor
empty.EChange.UNCHANGED
if a variable with the same name is
already present. Never null
.@Nullable public String getAppliedReplacement(@Nullable String sText)
IPSXPathVariables
getAppliedReplacement
in interface IPSXPathVariables
sText
- The source text. May be null
.null
if the
source text is null
.@Nonnull public com.helger.commons.state.EChange remove(@Nullable String sVarName)
sVarName
- The name of the variable to be removed. May be null
.EChange.CHANGED
if the variable was removed successfully.
Never null
.@Nonnull public com.helger.commons.state.EChange removeAll(@Nullable Iterable<String> aVars)
aVars
- A list of variable names to be removed. May be null
.EChange.CHANGED
if at least one variable was removed
successfully. Never null
.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsNavigableMap<String,String> getAll()
getAll
in interface IPSXPathVariables
null
.public boolean contains(@Nullable String sName)
contains
in interface IPSXPathVariables
sName
- Name of the variable to checktrue
if a variable with the passed name in present.@Nullable public String get(@Nullable String sName)
get
in interface IPSXPathVariables
sName
- Variable namenull
if no such variable is present.@Nonnull @ReturnsMutableCopy public PSXPathVariables getClone()
getClone
in interface com.helger.commons.lang.ICloneable<PSXPathVariables>
Copyright © 2014–2017 Philip Helger. All rights reserved.