public class JavaSamplerContext extends Object
Constructor and Description |
---|
JavaSamplerContext(org.apache.jmeter.config.Arguments args)
Create a new JavaSampler with the specified initialization parameters.
|
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.
|
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.
|
org.apache.jmeter.threads.JMeterContext |
getJMeterContext()
Returns
JMeterContext for the current thread. |
Properties |
getJMeterProperties()
Returns JMeter properties.
|
org.apache.jmeter.threads.JMeterVariables |
getJMeterVariables()
Returns
JMeterVariables for the current thread. |
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 JavaSamplerContext(org.apache.jmeter.config.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) throws NumberFormatException
name
- the name of the parameter whose value should be retrievedNumberFormatException
- if the parameter is not specified or is not an integerInteger.decode(java.lang.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.decode(java.lang.String)
public long getLongParameter(String name) throws NumberFormatException
name
- the name of the parameter whose value should be retrievedNumberFormatException
- if the parameter is not specified or is not a longLong.decode(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 org.apache.jmeter.threads.JMeterContext getJMeterContext()
JMeterContext
for the current thread.JMeterContext
for the current threadpublic final org.apache.jmeter.threads.JMeterVariables getJMeterVariables()
JMeterVariables
for the current thread.JMeterVariables
for the current thread.public final Properties getJMeterProperties()
Properties
JMeter propertiesCopyright © 1998-2020 Apache Software Foundation. All Rights Reserved.