Package org.openjdk.jmc.common.item
Class ItemToolkit
java.lang.Object
org.openjdk.jmc.common.item.ItemToolkit
Toolkit methods for performing operations on items.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> IMemberAccessor<T,
IItem> accessor
(IAttribute<T> a) Deprecated.This method returns a member accessor that is not thread safe.asIterable
(IItemCollection items) Deprecated.static <T> T
getFirstFound
(IItemCollection items, IAttribute<T> attribute) Returns the value of the event first encountered with the attribute.getItemType
(T item)
-
Constructor Details
-
ItemToolkit
public ItemToolkit()
-
-
Method Details
-
accessor
Deprecated.This method returns a member accessor that is not thread safe. Instead of creating an accessor that could be used for multiple item types, items should be iterated by type, preferably using anIAggregator
which enables parallel processing. -
asIterable
Deprecated. -
getItemType
-
getFirstFound
Returns the value of the event first encountered with the attribute. Note that it is usually a better idea to use Aggregators.AdvancedMinAggregator to truly get the first (time-wise) matching event. This method literally returns the attribute for the first item found when iterating through the IItems, one IItemIterable at a time.This method should only be used when you do not care which item you get; any matching is fine. This is commonly the case when looking up relatively static information dumped per chunk, for example environment variables. Also make sure that the collection is properly filtered down to only contain events where the attribute can be applied.
- Type Parameters:
T
- attribute value type- Parameters:
items
- items to search for attribute value inattribute
- the attribute to retrieve- Returns:
- the value of the attribute
- See Also:
-