Interface ItemResolver
@PublicApi
public interface ItemResolver
-
Method Summary
Modifier and TypeMethodDescription<T> T
resolveItem
(ItemIdentity itemId, Class<T> itemClass) <T> void
resolveItems
(Collection<ItemIdentity> itemIds, Class<T> itemClass, BiConsumer<ItemIdentity, T> consumer) Resolves all the items from the given id collection and passes them to consumer.void
resolveItemsUnchecked
(Collection<ItemIdentity> itemIds, BiConsumer<ItemIdentity, Object> consumer) Resolves all the items from the given id collection and passes them to consumer.resolveUnchecked
(ItemIdentity itemId)
-
Method Details
-
resolveItem
-
resolveUnchecked
-
resolveItems
<T> void resolveItems(@NotNull Collection<ItemIdentity> itemIds, @NotNull Class<T> itemClass, @NotNull BiConsumer<ItemIdentity, T> consumer) Resolves all the items from the given id collection and passes them to consumer. Item retrieving is done with a permission check. Bulk resolve is used when available. If an item is unresolved for any reason, including that the item is unavailable for the current user, null is passed to the consumer. Thus, all the items are passed to the consumer together with the corresponding item id.- Type Parameters:
T
- type of expected item class- Parameters:
itemIds
- id collection of items to retrieveitemClass
- expected item classconsumer
- handler for (item id, item) pairs
-
resolveItemsUnchecked
void resolveItemsUnchecked(@NotNull Collection<ItemIdentity> itemIds, @NotNull BiConsumer<ItemIdentity, Object> consumer) Resolves all the items from the given id collection and passes them to consumer. No permission check is performed here. Bulk resolve is used when available. If an item is unresolved for any reason, null is passed to the consumer. Thus, all the items are passed to the consumer together with the corresponding item id.- Parameters:
itemIds
- id collection of items to retrieveconsumer
- handler for (item id, item) pairs
-