|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<K,V> java.util.LinkedHashMap<java.lang.String,java.lang.Object> com.splunk.Args
public class Args
The Args
class is a helper class for working with Splunk REST API
arguments.
This extension is used mainly for encoding arguments for UTF8 transmission
to a Splunk instance in a key=value pairing for a string, or
key=value1&key=value2 (and so on) for an array of strings.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
Args()
Class constructor. |
|
Args(java.util.Map<java.lang.String,java.lang.Object> values)
Class constructor. |
|
Args(java.lang.String key,
java.lang.Object value)
Class constructor. |
Method Summary | ||
---|---|---|
Args |
add(java.lang.String key,
java.lang.Object value)
Adds an argument to an Args object. |
|
static Args |
create()
Creates a new empty instance of Args . |
|
static Args |
create(java.util.Map<java.lang.String,java.lang.Object> values)
Creates a new Args instance and initializes it with a
pre-existing hash map. |
|
static Args |
create(java.lang.String key,
java.lang.Object value)
Creates a new Args instance and initializes it with a single
key-value pair. |
|
java.lang.String |
encode()
Encodes an Args instance into a UTF8-encoded string. |
|
static java.lang.String |
encode(java.util.Map<java.lang.String,java.lang.Object> args)
Encodes a hash map of String:String or String:String[]
into a single UTF8-encoded string. |
|
static java.lang.String |
encode(java.lang.String value)
Encodes a single string with UTF8 encoding. |
|
static
|
get(java.util.Map<java.lang.String,java.lang.Object> args,
java.lang.String key,
T defaultValue)
Returns the hash-map value of a specific key, or the default value if the key is not found. |
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get |
Methods inherited from class java.util.HashMap |
---|
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Constructor Detail |
---|
public Args()
public Args(java.lang.String key, java.lang.Object value)
key
- The key name.value
- The value, as a String:String
or
String:String[]
.public Args(java.util.Map<java.lang.String,java.lang.Object> values)
values
- A set of key-value pairs.Method Detail |
---|
public Args add(java.lang.String key, java.lang.Object value)
Args
object.
key
- The key name.value
- The value, as a String:String
or
String:String[]
.
Args
set.public static Args create()
Args
.
Args
instance.public static Args create(java.lang.String key, java.lang.Object value)
Args
instance and initializes it with a single
key-value pair.
key
- The key name.value
- The value, as a String:String
or
String:String[]
.
Args
instance.public static Args create(java.util.Map<java.lang.String,java.lang.Object> values)
Args
instance and initializes it with a
pre-existing hash map.
values
- The pre-existing hash map.
Args
instance.public static java.lang.String encode(java.lang.String value)
value
- The string.
public static java.lang.String encode(java.util.Map<java.lang.String,java.lang.Object> args)
String:String
or String:String[]
into a single UTF8-encoded string.
args
- The hash map.
public java.lang.String encode()
Args
instance into a UTF8-encoded string.
public static <T> T get(java.util.Map<java.lang.String,java.lang.Object> args, java.lang.String key, T defaultValue)
T
- The class type.args
- The hash map.key
- The key to look for.defaultValue
- The default value, if the key is not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |