@Override public List<Category> findChildren(final Identifiable<Category> category) { final String categoryId = category.getId(); return childrenByParentId.getOrDefault(categoryId, Collections.emptyList()); }
@Override public List<Category> findChildren(final Identifiable<Category> category) { final String categoryId = category.getId(); return childrenByParentId.getOrDefault(categoryId, Collections.emptyList()); }
@Override public List<Category> findChildren(final Identifiable<Category> category) { final String categoryId = category.getId(); return childrenByParentId.getOrDefault(categoryId, Collections.emptyList()); } }
static Category getCategoryOrThrow(final Identifiable<Category> category, final CategoryTree categoryTree) { return categoryTree.findById(category.getId()) .orElseThrow(() -> new IllegalArgumentException(format("%s is not part of the category tree", category))); } }
static Category getCategoryOrThrow(final Identifiable<Category> category, final CategoryTree categoryTree) { return categoryTree.findById(category.getId()) .orElseThrow(() -> new IllegalArgumentException(format("%s is not part of the category tree", category))); } }
static TaxCategoryByIdGet of(final Identifiable<TaxCategory> resource) { return of(resource.getId()); }
static MessageByIdGet of(final Identifiable<Message> resource) { return of(resource.getId()); }
static ProductByIdGet of(final Identifiable<Product> product) { return of(product.getId()); }
static ZoneByIdGet of(final Identifiable<Zone> resource) { return of(resource.getId()); }
static StateByIdGet of(final Identifiable<State> state) { return of(state.getId()); }
static MessageByIdGet of(final Identifiable<Message> message) { return of(message.getId()); }
static CustomerGroupByIdGet of(final Identifiable<CustomerGroup> customerGroup) { return of(customerGroup.getId()); }
static ShippingMethodByIdGet of(final Identifiable<ShippingMethod> shippingMethod) { return of(shippingMethod.getId()); }
static CartByCustomerIdGet of(final Identifiable<Customer> customer) { return of(customer.getId()); }
static StateByIdGet of(final Identifiable<State> resource) { return of(resource.getId()); }
static CartByIdGet of(final Identifiable<Cart> resource) { return of(resource.getId()); }
static DiscountCodeByIdGet of(final Identifiable<DiscountCode> resource) { return of(resource.getId()); }
public static <T> List<String> toIds(final Iterable<? extends Identifiable<T>> elements) { return toStream(elements).map(element -> element.getId()).collect(toList()); }
static ChannelByIdGet of(final Identifiable<Channel> channel) { return of(channel.getId()); }
static ZoneByIdGet of(final Identifiable<Zone> zone) { return of(zone.getId()); }