public class BackendListenerContext extends Object
All of the methods in this class are currently read-only. If update methods
are included in the future, they should be defined so that a single instance
of BackendListenerContext
can be associated with each thread.
Therefore, no synchronization should be needed. The same instance should
be used for all calls to setupTest, runTest, and teardownTest.
Constructor and Description |
---|
BackendListenerContext(Arguments args) |
BackendListenerContext(Map<String,String> params) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsParameter(String name)
Determine whether or not a value has been specified for the parameter
with this name.
|
boolean |
getBooleanParameter(String name,
boolean defaultValue) |
int |
getIntParameter(String name)
Get the value of a specified parameter as an integer.
|
int |
getIntParameter(String name,
int defaultValue)
Get the value of a specified parameter as an integer, or return the
specified default value if the value was not specified or is not an
integer.
|
long |
getLongParameter(String name)
Get the value of a specified parameter as a long.
|
long |
getLongParameter(String name,
long defaultValue)
Get the value of a specified parameter as along, or return the specified
default value if the value was not specified or is not a long.
|
String |
getParameter(String name)
Get the value of a specific parameter as a String, or null if the value
was not specified.
|
String |
getParameter(String name,
String defaultValue)
Get the value of a specified parameter as a String, or return the
specified default value if the value was not specified.
|
Iterator<String> |
getParameterNamesIterator()
Get an iterator of the parameter names.
|
public BackendListenerContext(Arguments args)
args
- the initialization parameters.public boolean containsParameter(String name)
name
- the name of the parameter to testpublic Iterator<String> getParameterNamesIterator()
public String getParameter(String name)
name
- the name of the parameter whose value should be retrievedpublic String getParameter(String name, String defaultValue)
name
- the name of the parameter whose value should be retrieveddefaultValue
- the default value to return if the value of this parameter was
not specifiedpublic int getIntParameter(String name)
name
- the name of the parameter whose value should be retrievedIllegalArgumentException
- if no value definedNumberFormatException
- if the parameter is not specified or is not an integerInteger.parseInt(String)
public int getIntParameter(String name, int defaultValue)
name
- the name of the parameter whose value should be retrieveddefaultValue
- the default value to return if the value of this parameter was
not specifiedInteger.parseInt(String)
public long getLongParameter(String name)
name
- the name of the parameter whose value should be retrievedNumberFormatException
- if the parameter is not specified or is not a longLong.parseLong(String)
public long getLongParameter(String name, long defaultValue)
name
- the name of the parameter whose value should be retrieveddefaultValue
- the default value to return if the value of this parameter was
not specifiedLong.decode(String)
public boolean getBooleanParameter(String name, boolean defaultValue)
name
- Parameter namedefaultValue
- Default value used if name is not in paramsCopyright © 1998-2021 Apache Software Foundation. All Rights Reserved.