public class ProtocolVariables extends Object
This class manages a list of connection variables. Connection variables are placeholders for strings in the connections string of the SmartInspect class. Please see SmartInspect.setVariable for more information.
This class is fully threadsafe.
| Constructor and Description |
|---|
ProtocolVariables()
Creates and initializes a ProtocolVariables instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String key,
String value)
Adds a new element with a specified key and value to the
set of connection variables.
|
void |
clear()
Removes all key/value pairs of the collection.
|
boolean |
contains(String key)
Tests if the collection contains a value for a given key.
|
String |
expand(String connections)
Expands and returns a connections string.
|
String |
get(String key)
Returns a value of an element for a given key.
|
int |
getCount()
Returns the number of key/value pairs of this collection.
|
void |
put(String key,
String value)
Adds or updates an element with a specified key and value to the set of connection variables.
|
void |
remove(String key)
Removes an existing element with a given key from this set
of connection variables.
|
public ProtocolVariables()
public void put(String key, String value)
key - The key of the elementvalue - The value of the elementNullPointerException - If the key or value argument is nullpublic void add(String key, String value)
key - The key of the elementvalue - The value of the elementNullPointerException - if the key or value argument is nullpublic void remove(String key)
This method removes the element with the given key from the internal set of connection variables. Nothing happens if no element with the given key can be found.
key - The key of the element to removeNullPointerException - If the key argument is nullpublic boolean contains(String key)
key - The key to test forNullPointerException - if the key argument is nullpublic void clear()
public int getCount()
public String expand(String connections)
connections - The connections string to expand and returnNullPointerException - If the connections argument is nullpublic String get(String key)
key - The key whose value to returnNullPointerException - if the key argument is nullCopyright © 2023. All rights reserved.