/** * Given a list of {@link PromotionMessageDTO}s, gather their message properties. * * @param promotionMessages * @return messages */ public static List<String> gatherMessagesFromDTOs(List<PromotionMessageDTO> promotionMessages) { return BLCCollectionUtils.collectList(promotionMessages, new TypedTransformer<String>() { @Override public String transform(Object input) { PromotionMessageDTO promotionMessage = (PromotionMessageDTO) input; return promotionMessage.getMessage(); } }); }
protected boolean isSamePermutation(List<ProductOptionValue> perm1, List<ProductOptionValue> perm2) { if (perm1.size() == perm2.size()) { Collection<Long> perm1Ids = BLCCollectionUtils.collect(perm1, new TypedTransformer<Long>() { @Override public Long transform(Object input) { return ((ProductOptionValue) input).getId(); } }); Collection<Long> perm2Ids = BLCCollectionUtils.collect(perm2, new TypedTransformer<Long>() { @Override public Long transform(Object input) { return ((ProductOptionValue) input).getId(); } }); return perm1Ids.containsAll(perm2Ids); } return false; }
public List<String> getFilterValues() { // We want values that are NOT special return BLCCollectionUtils.selectList(filterValues, getPredicateForSpecialValues(false)); }
/** * Given a list of {@link PromotionMessage}s, gather their message properties. * * @param promotionMessages * @return messages */ public static List<String> gatherMessages(List<PromotionMessage> promotionMessages) { return BLCCollectionUtils.collectList(promotionMessages, new TypedTransformer<String>() { @Override public String transform(Object input) { PromotionMessage promotionMessage = (PromotionMessage) input; return promotionMessage.getMessage(); } }); }
public List<String> getSpecialFilterValues() { // We want values that ARE special return BLCCollectionUtils.selectList(filterValues, getPredicateForSpecialValues(true)); }
protected boolean isSamePermutation(List<ProductOptionValue> perm1, List<ProductOptionValue> perm2) { if (perm1.size() == perm2.size()) { Collection<Long> perm1Ids = BLCCollectionUtils.collect(perm1, new TypedTransformer<Long>() { @Override public Long transform(Object input) { return ((ProductOptionValue) input).getId(); } }); Collection<Long> perm2Ids = BLCCollectionUtils.collect(perm2, new TypedTransformer<Long>() { @Override public Long transform(Object input) { return ((ProductOptionValue) input).getId(); } }); return perm1Ids.containsAll(perm2Ids); } return false; }
/** * Given a map of {@link PromotionMessagePlacementType}s to {@link PromotionMessageDTO}s, gather the message properties. * * @param promotionMessageMap * @param type * @return messages */ public static List<String> gatherMessagesByPlacementType(Map<String, List<PromotionMessageDTO>> promotionMessageMap, PromotionMessagePlacementType type) { List<PromotionMessageDTO> promotionMessageDTOs = promotionMessageMap.get(type.getType()); if (promotionMessageDTOs == null) { return new ArrayList<>(); } return BLCCollectionUtils.collectList(promotionMessageDTOs, new TypedTransformer<String>() { @Override public String transform(Object input) { PromotionMessageDTO promotionMessageDTO = (PromotionMessageDTO) input; return promotionMessageDTO.getMessage(); } }); }
Entity entity = payload[i]; List<ProductOptionValue> optionValues = BLCCollectionUtils.collectList(sku.getProductOptionValueXrefs(), new TypedTransformer<ProductOptionValue>() { @Override public ProductOptionValue transform(Object input) {
cto.getCriteriaMap().remove("defaultCategory"); List<Long> transformedValues = BLCCollectionUtils.collectList(filterValues, new TypedTransformer<Long>() { @Override public Long transform(Object input) {
List<Locale> locales = getAllLocales(); List<Long> productIds = BLCCollectionUtils.collectList(indexables, new TypedTransformer<Long>() { @Override public Long transform(Object input) {