Package org.openjdk.jmc.common.item
Class ItemToolkit
- java.lang.Object
-
- org.openjdk.jmc.common.item.ItemToolkit
-
public class ItemToolkit extends Object
Toolkit methods for performing operations on items.
-
-
Constructor Summary
Constructors Constructor Description ItemToolkit()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T> IMemberAccessor<T,IItem>
accessor(IAttribute<T> a)
Deprecated.This method returns a member accessor that is not thread safe.static Iterable<IItem>
asIterable(IItemCollection items)
Deprecated.static <T> T
getFirstFound(IItemCollection items, IAttribute<T> attribute)
Returns the value of the event first encountered with the attribute.static <T extends IItem>
IType<T>getItemType(T item)
-
-
-
Method Detail
-
accessor
@Deprecated public static <T> IMemberAccessor<T,IItem> accessor(IAttribute<T> a)
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 public static Iterable<IItem> asIterable(IItemCollection items)
Deprecated.
-
getFirstFound
public static <T> T getFirstFound(IItemCollection items, IAttribute<T> attribute)
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:
Aggregators.AdvancedMinAggregator
-
-