Package org.mozilla.zest.core.v1
Class ZestVariables
- java.lang.Object
-
- org.mozilla.zest.core.v1.ZestElement
-
- org.mozilla.zest.core.v1.ZestVariables
-
public class ZestVariables extends ZestElement
The Class ZestTokens.
-
-
Field Summary
Fields Modifier and Type Field Description static StringREQUEST_BODYThe Request Body.static StringREQUEST_HEADERThe Request Headers.static StringREQUEST_METHODThe Request URL.static StringREQUEST_URLThe Request URL.static StringRESPONSE_BODYThe Response Body.static StringRESPONSE_HEADERThe Response Headers.static StringRESPONSE_URLThe Response URL.-
Fields inherited from class org.mozilla.zest.core.v1.ZestElement
JSON_ELEMENT_TYPE
-
-
Constructor Summary
Constructors Constructor Description ZestVariables()Instantiates a new zest tokens.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVariable(String name)Adds the token.voidaddVariable(String name, String value)Adds the token.voidaddVariables(Map<String,String> tokens)Adds the tokens.ZestVariablesdeepCopy()Deep copy.StringgetTokenEnd()Gets the token end.StringgetTokenStart()Gets the token start.StringgetVariable(String name)Gets the token.List<String[]>getVariables()Gets the tokens.Map<String,String>getVariablesMap()Gets the variables as a map, name to value.StringreplaceInString(String str, boolean urlEncode)voidsetTokenEnd(String tokenEnd)Sets the token end.voidsetTokenStart(String tokenStart)Sets the token start.voidsetVariable(String name, String value)Sets the token.voidsetVariable(Map<String,String> tokens)Sets the tokens.-
Methods inherited from class org.mozilla.zest.core.v1.ZestElement
getElementType, isSameSubclass, setElementType
-
-
-
-
Field Detail
-
REQUEST_URL
public static final String REQUEST_URL
The Request URL.- See Also:
- Constant Field Values
-
REQUEST_METHOD
public static final String REQUEST_METHOD
The Request URL.- See Also:
- Constant Field Values
-
REQUEST_HEADER
public static final String REQUEST_HEADER
The Request Headers.- See Also:
- Constant Field Values
-
REQUEST_BODY
public static final String REQUEST_BODY
The Request Body.- See Also:
- Constant Field Values
-
RESPONSE_URL
public static final String RESPONSE_URL
The Response URL.- See Also:
- Constant Field Values
-
RESPONSE_HEADER
public static final String RESPONSE_HEADER
The Response Headers.- See Also:
- Constant Field Values
-
RESPONSE_BODY
public static final String RESPONSE_BODY
The Response Body.- See Also:
- Constant Field Values
-
-
Method Detail
-
deepCopy
public ZestVariables deepCopy()
Description copied from class:ZestElementDeep copy.- Specified by:
deepCopyin classZestElement- Returns:
- the zest element
-
getTokenStart
public String getTokenStart()
Gets the token start.- Returns:
- the token start
-
setTokenStart
public void setTokenStart(String tokenStart)
Sets the token start.- Parameters:
tokenStart- the new token start
-
getTokenEnd
public String getTokenEnd()
Gets the token end.- Returns:
- the token end
-
setTokenEnd
public void setTokenEnd(String tokenEnd)
Sets the token end.- Parameters:
tokenEnd- the new token end
-
getVariable
public String getVariable(String name)
Gets the token.- Parameters:
name- the name- Returns:
- the token
-
setVariable
public void setVariable(Map<String,String> tokens)
Sets the tokens.It's created a copy of the given map.
- Parameters:
tokens- the tokens
-
getVariablesMap
public Map<String,String> getVariablesMap()
Gets the variables as a map, name to value.- Returns:
- an unmodifiable map containing the variables.
- Since:
- 0.14.0
-
addVariable
public void addVariable(String name, String value)
Adds the token.- Parameters:
name- the namevalue- the value
-
addVariable
public void addVariable(String name)
Adds the token.- Parameters:
name- the name
-
addVariables
public void addVariables(Map<String,String> tokens)
Adds the tokens.- Parameters:
tokens- the tokens
-
setVariable
public void setVariable(String name, String value)
Sets the token.- Parameters:
name- the namevalue- the value
-
-