T
- The type of members in the collection.public class EntityCollection<T extends Entity> extends ResourceCollection<T>
EntityCollection
class represents a collection of Splunk
entities.itemClass, items
Constructor and Description |
---|
EntityCollection(Service service,
String path,
Class itemClass,
Args args)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
create(String name)
Creates an entity in this collection.
|
T |
create(String name,
Map args)
Creates an entity in this collection.
|
T |
remove(String key)
Removes an entity from this collection.
|
T |
remove(String key,
Args namespace)
Removes an entity from this collection, with a namespace restriction.
|
clear, containsKey, containsKey, containsValue, createItem, createItem, entrySet, equals, get, get, hashCode, isEmpty, itemKey, itemPath, keySet, list, put, putAll, refresh, remove, size, validate, values, valueSize
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
public EntityCollection(Service service, String path, Class itemClass, Args args)
service
- The connected Service
instance.path
- The entity's endpoint.itemClass
- The entity's class.args
- Collection arguments that specify the number of entities to
return and how to sort them (see CollectionArgs
).public T create(String name)
name
- The name of the entity.public T create(String name, Map args)
name
- The name of the entity.args
- Arguments for creating the entity.public T remove(String key)
key
- The name of the entity to remove.SplunkException
- The exception "AMBIGUOUS" if the collection
contains more than one entity with the specified key. Disambiguation is
done through a similar method,
remove(Object key, HashMap<String,String>namespace
, which uses
the namespace to perform the disambiguation.Copyright © 2022 Splunk, Inc.. All rights reserved.