Package com.thingworx.metrics
Interface IMetricSet<T>
- Type Parameters:
T
- the type of items stored in the set
- All Superinterfaces:
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
Modifier and TypeMethodDescriptionvoid
Adds an item to the set.void
Adds an item to the set with optional persistence.void
Removes an item from the set, if it exists.void
Removes an item from the set with optional persistence, if it exists.snapshot()
Returns a snapshot of this metric's set.
-
Method Details
-
add
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
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
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
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
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
-