Package com.thingworx.metrics
Interface IMetricSet<T>
-
- Type Parameters:
T
- the type of items stored in the set
- All Superinterfaces:
IMetric
@ThingworxExtensionApiClass(since={8,1,1}) public interface IMetricSet<T> extends IMetric
A metric that stores a set of values. The backing set is owned by the metric directly.
-
-
Field Summary
-
Fields inherited from interface com.thingworx.metrics.IMetric
METRIC_TYPE, VALUE, VALUE_TYPE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(T item)
Adds an item to the set.void
add(T item, boolean persist)
Adds an item to the set with optional persistence.void
remove(T item)
Removes an item from the set, if it exists.void
remove(T item, boolean persist)
Removes an item from the set with optional persistence, if it exists.java.util.Set<T>
snapshot()
Returns a snapshot of this metric's set.
-
-
-
Method Detail
-
add
@ThingworxExtensionApiMethod(since={8,1,1}) void add(T item)
Adds an item to the set. If the item already is in the set, no change will occur.- Parameters:
item
- the item to add
-
add
@ThingworxExtensionApiMethod(since={8,3}) void add(T item, boolean persist)
Adds an item to the set with optional persistence. If the item already is in the set, no change will occur.- Parameters:
item
- the item to addpersist
- whether or not to persist the metric set data
-
remove
@ThingworxExtensionApiMethod(since={8,1,1}) void remove(T item)
Removes an item from the set, if it exists. If the item is not in the set, no change will occur.- Parameters:
item
- the item to remove
-
remove
@ThingworxExtensionApiMethod(since={8,3}) void remove(T item, boolean persist)
Removes an item from the set with optional persistence, if it exists. If the item is not in the set, no change will occur.- Parameters:
item
- the item to removepersist
- whether or not to persist the metric set data
-
snapshot
@ThingworxExtensionApiMethod(since={8,3}) java.util.Set<T> snapshot()
Returns a snapshot of this metric's set. Note that the contents of the metric may change after calling this method, which will not be reflected by the returned set.- Returns:
- the items stored in this metric
-
-