org.apache.jmeter.config

Class Arguments

Implemented Interfaces:
Cloneable, Serializable, ConfigElement, TestElement

public class Arguments
extends ConfigTestElement
implements Serializable

A set of Argument objects.

Field Summary

static String
ARGUMENTS
The name of the property used to store the arguments.

Fields inherited from class org.apache.jmeter.config.ConfigTestElement

PASSWORD, USERNAME

Fields inherited from interface org.apache.jmeter.testelement.TestElement

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Constructor Summary

Arguments()
Create a new Arguments object with no arguments.

Method Summary

void
addArgument(String name, String value)
Add a new argument with the given name and value.
void
addArgument(String name, String value, String metadata)
Add a new argument with the given name, value, and metadata.
void
addArgument(Argument arg)
Add a new argument.
void
addEmptyArgument()
Add a new empty argument to the list.
void
clear()
Clear the arguments.
Argument
getArgument(int row)
Get a single argument.
int
getArgumentCount()
Get the number of arguments in the list.
CollectionProperty
getArguments()
Get the arguments.
Map
getArgumentsAsMap()
Get the arguments as a Map.
PropertyIterator
iterator()
Get a PropertyIterator of the arguments.
void
removeAllArguments()
Remove all arguments from the list.
void
removeArgument(String argName)
Remove the argument with the specified name.
void
removeArgument(int row)
Remove the specified argument from the list.
void
removeArgument(Argument arg)
Remove the specified argument from the list.
void
setArguments(List arguments)
Set the list of arguments.
String
toString()
Create a string representation of the arguments.

Methods inherited from class org.apache.jmeter.config.ConfigTestElement

addConfigElement, addTestElement, expectsModification

Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty

Field Details

ARGUMENTS

public static final String ARGUMENTS
The name of the property used to store the arguments.

Constructor Details

Arguments

public Arguments()
Create a new Arguments object with no arguments.

Method Details

addArgument

public void addArgument(String name,
                        String value)
Add a new argument with the given name and value.
Parameters:
name - the name of the argument
value - the value of the argument

addArgument

public void addArgument(String name,
                        String value,
                        String metadata)
Add a new argument with the given name, value, and metadata.
Parameters:
name - the name of the argument
value - the value of the argument
metadata - the metadata for the argument

addArgument

public void addArgument(Argument arg)
Add a new argument.
Parameters:
arg - the new argument

addEmptyArgument

public void addEmptyArgument()
Add a new empty argument to the list. The new argument will have the empty string as its name and value, and null metadata.

clear

public void clear()
Clear the arguments.
Specified by:
clear in interface TestElement
Overrides:
clear in interface AbstractTestElement

getArgument

public Argument getArgument(int row)
Get a single argument.
Parameters:
row - the index of the argument to return.
Returns:
the argument at the specified index, or null if no argument exists at that index.

getArgumentCount

public int getArgumentCount()
Get the number of arguments in the list.
Returns:
the number of arguments

getArguments

public CollectionProperty getArguments()
Get the arguments.
Returns:
the arguments

getArgumentsAsMap

public Map getArgumentsAsMap()
Get the arguments as a Map. Each argument name is used as the key, and its value as the value.
Returns:
a new Map with String keys and values containing the arguments

iterator

public PropertyIterator iterator()
Get a PropertyIterator of the arguments.
Returns:
an iteration of the arguments

removeAllArguments

public void removeAllArguments()
Remove all arguments from the list.

removeArgument

public void removeArgument(String argName)
Remove the argument with the specified name.
Parameters:
argName - the name of the argument to remove

removeArgument

public void removeArgument(int row)
Remove the specified argument from the list.
Parameters:
row - the index of the argument to remove

removeArgument

public void removeArgument(Argument arg)
Remove the specified argument from the list.
Parameters:
arg - the argument to remove

setArguments

public void setArguments(List arguments)
Set the list of arguments. Any existing arguments will be lost.
Parameters:
arguments - the new arguments

toString

public String toString()
Create a string representation of the arguments.
Returns:
the string representation of the arguments

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.