Class EntryMergeFilterSubscription

  • All Implemented Interfaces:
    EntryMergeFilter, java.util.function.BiFunction<AbstractOrderEntryModel,​AbstractOrderEntryModel,​java.lang.Boolean>

    public class EntryMergeFilterSubscription
    extends java.lang.Object
    implements EntryMergeFilter
    Denies merging of entries with subscription products.

    Quantity of subscription entries should always be 1, so any merge between subscription entries should be disabled.

    • Constructor Detail

      • EntryMergeFilterSubscription

        public EntryMergeFilterSubscription()
    • Method Detail

      • apply

        public java.lang.Boolean apply​(@Nonnull
                                       AbstractOrderEntryModel candidate,
                                       @Nonnull
                                       AbstractOrderEntryModel target)
        Description copied from interface: EntryMergeFilter
        Return Boolean.FALSE to create the item given by parameter as a separate cart entry or Boolean.TRUE to allow it to be merged into the given entry.

        Please be aware that allowing to merge does not always means the entries will be merged. There could be another filter registered, that could deny the merge.

        Specified by:
        apply in interface java.util.function.BiFunction<AbstractOrderEntryModel,​AbstractOrderEntryModel,​java.lang.Boolean>
        Specified by:
        apply in interface EntryMergeFilter
        Parameters:
        candidate - merge candidate
        target - entry to merge the candidate into
        Returns:
        TRUE is the merge is allowed
      • setSubscriptionProductService

        public void setSubscriptionProductService​(SubscriptionProductService subscriptionProductService)