Package org.xwiki.rendering.wikimodel
Class WikiParameters
- java.lang.Object
-
- org.xwiki.rendering.wikimodel.WikiParameters
-
- All Implemented Interfaces:
Iterable<WikiParameter>
- Direct Known Subclasses:
XWikiWikiParameters
public class WikiParameters extends Object implements Iterable<WikiParameter>
Allow iterating overWikiParameter
s.- Since:
- 4.0M1
- Version:
- $Id: cf7ce3da44e25bb9cd7f9e278c1be13533d3b799 $
-
-
Field Summary
Fields Modifier and Type Field Description static char
DEFAULT_ESCAPECHAR
The default character to use has escaping char.static WikiParameters
EMPTY
An empty parameter listprotected List<WikiParameter>
fList
-
Constructor Summary
Constructors Constructor Description WikiParameters()
WikiParameters(String str)
WikiParameters(String str, char escapeChar)
WikiParameters(String str, String delimiter)
WikiParameters(Collection<WikiParameter> list)
WikiParameters(WikiParameters parameters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WikiParameters
addParameter(String key, String value)
Creates a new copy of this parameter object with new specified key/value pair.WikiParameters
addParameters(WikiParameters parameters)
boolean
equals(Object obj)
WikiParameter
getParameter(int pos)
WikiParameter
getParameter(String key)
WikiParameter[]
getParameters(String key)
Returns all parameters with this keyint
getSize()
Returns the number of parameters in the internal list.int
hashCode()
Iterator<WikiParameter>
iterator()
static WikiParameters
newWikiParameters(String str)
static WikiParameters
newWikiParameters(String str, char escapeChar)
WikiParameters
remove(String key)
WikiParameters
setParameter(String key, String value)
List<WikiParameter>
toList()
Returns a new list containing all parameters defined in this object.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
DEFAULT_ESCAPECHAR
public static final char DEFAULT_ESCAPECHAR
The default character to use has escaping char.- See Also:
- Constant Field Values
-
EMPTY
public static final WikiParameters EMPTY
An empty parameter list
-
fList
protected final List<WikiParameter> fList
-
-
Constructor Detail
-
WikiParameters
public WikiParameters()
-
WikiParameters
public WikiParameters(Collection<WikiParameter> list)
- Parameters:
list
-
-
WikiParameters
public WikiParameters(String str)
- Parameters:
str
-
-
WikiParameters
public WikiParameters(String str, char escapeChar)
-
WikiParameters
public WikiParameters(WikiParameters parameters)
-
-
Method Detail
-
newWikiParameters
public static WikiParameters newWikiParameters(String str)
-
newWikiParameters
public static WikiParameters newWikiParameters(String str, char escapeChar)
-
addParameter
public WikiParameters addParameter(String key, String value)
Creates a new copy of this parameter object with new specified key/value pair.- Parameters:
key
- the parameter namevalue
- the value of the parameter- Returns:
- a new copy of parameters object with the given key/value pair
-
addParameters
public WikiParameters addParameters(WikiParameters parameters)
-
setParameter
public WikiParameters setParameter(String key, String value)
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
getParameter
public WikiParameter getParameter(int pos)
- Parameters:
pos
- the position of the parameter- Returns:
- the parameter from the specified position
-
getParameter
public WikiParameter getParameter(String key)
- Parameters:
key
- the key of the parameter- Returns:
- the wiki parameter by key
-
getParameters
public WikiParameter[] getParameters(String key)
Returns all parameters with this key- Parameters:
key
- the key of the parameter- Returns:
- the wiki parameter by key
-
getSize
public int getSize()
Returns the number of parameters in the internal list.- Returns:
- the number of parameters in the internal list
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
iterator
public Iterator<WikiParameter> iterator()
- Specified by:
iterator
in interfaceIterable<WikiParameter>
-
remove
public WikiParameters remove(String key)
- Parameters:
key
- the key of the parameter to remove- Returns:
- a new copy of parameter list without the specified parameter; if this parameter list does not contain such a key then this method returns a reference to this object
-
toList
public List<WikiParameter> toList()
Returns a new list containing all parameters defined in this object.- Returns:
- a list of all parameters
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
-