T
- The type of members of the collection.public class ResourceCollection<T extends Resource> extends Resource implements Map<String,T>
ResourceCollection
abstract base class represents a collection of
Splunk resources.Modifier and Type | Field and Description |
---|---|
protected Class |
itemClass |
protected LinkedHashMap<String,LinkedList<T>> |
items |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsKey(Object key,
Args namespace)
Determines whether a scoped, namespace-constrained key
exists within this collection.
|
boolean |
containsValue(Object value) |
protected T |
createItem(AtomEntry entry)
Creates a collection member corresponding to a given
Atom entry.
|
protected T |
createItem(Class itemClass,
String path,
Args namespace)
Creates a collection member.
|
Set<Map.Entry<String,T>> |
entrySet() |
boolean |
equals(Object o) |
T |
get(Object key)
Gets the value of a given key, if it exists within this collection.
|
T |
get(Object key,
Args namespace)
Gets a the value of a scoped, namespace-constrained key, if it exists
within this collection.
|
int |
hashCode() |
boolean |
isEmpty() |
protected String |
itemKey(AtomEntry entry)
Returns the value to use as the key from a given Atom entry.
|
protected String |
itemPath(AtomEntry entry)
Returns the value to use as the member's path from a given Atom entry.
|
Set<String> |
keySet() |
ResponseMessage |
list()
Issues an HTTP request to list the contents of the collection resource.
|
T |
put(String key,
T value) |
void |
putAll(Map<? extends String,? extends T> map)
Copies all mappings from a given map to this map (unsupported).
|
ResourceCollection |
refresh()
Refreshes the local state of this resource.
|
T |
remove(Object key) |
int |
size() |
ResourceCollection<T> |
validate()
Ensures that the local state of the resource is current,
calling
refresh if necessary. |
Collection<T> |
values() |
int |
valueSize(Object key)
Returns the number of values that a specific key represents.
|
getName, getPath, getService, getTitle, getUpdated, invalidate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected LinkedHashMap<String,LinkedList<T extends Resource>> items
protected Class itemClass
public boolean containsKey(Object key)
containsKey
in interface Map<String,T extends Resource>
public boolean containsKey(Object key, Args namespace)
key
- The key to look up.namespace
- The namespace to constrain the search to.true
if the key exists, false
if not.public boolean containsValue(Object value)
containsValue
in interface Map<String,T extends Resource>
protected T createItem(Class itemClass, String path, Args namespace)
itemClass
- The class of the member to create.path
- The path to the member resource.namespace
- The namespace.protected T createItem(AtomEntry entry)
ResourceCollection
was created.
Subclasses may override this method to provide alternative means of
instantiating collection members.entry
- The AtomEntry
corresponding to the member to
instantiate.public boolean equals(Object o)
public T get(Object key, Args namespace)
key
- The key to look up.namespace
- The namespace to constrain the search to.null
if it doesn't
exist.public int hashCode()
protected String itemKey(AtomEntry entry)
entry
- The AtomEntry
corresponding to the collection
member.protected String itemPath(AtomEntry entry)
entry
- The AtomEntry
corresponding to the collection
member.public ResponseMessage list()
public void putAll(Map<? extends String,? extends T> map)
public ResourceCollection refresh()
public ResourceCollection<T> validate()
refresh
if necessary.public Collection<T> values()
public int valueSize(Object key)
key
- The key to look up.Copyright © 2022 Splunk, Inc.. All rights reserved.