Class DefaultEntryGroupService

    • Constructor Detail

      • DefaultEntryGroupService

        public DefaultEntryGroupService()
    • Method Detail

      • getRoot

        @Nonnull
        public EntryGroup getRoot​(@Nonnull
                                  AbstractOrderModel order,
                                  @Nonnull
                                  java.lang.Integer groupNumber)
        Description copied from interface: EntryGroupService
        Returns root of the tree within the order's entry group trees which has given group.
        Specified by:
        getRoot in interface EntryGroupService
        Parameters:
        order - order to take trees from
        groupNumber - number of group to search for
        Returns:
        root of the tree that contains groupNumber
      • getParent

        public EntryGroup getParent​(@Nonnull
                                    AbstractOrderModel order,
                                    @Nonnull
                                    java.lang.Integer groupNumber)
        Description copied from interface: EntryGroupService
        Returns parent entry group of the tree within the order's entry group trees which has given group.
        Specified by:
        getParent in interface EntryGroupService
        Parameters:
        order - order to take trees from
        groupNumber - number of group to search for
        Returns:
        parent of the groupNumber or null if it is root
      • forceOrderSaving

        public void forceOrderSaving​(@Nonnull
                                     AbstractOrderModel order)
        Description copied from interface: EntryGroupService
        As EntryGroup is not a DB entity, changing it does not cause parent order to save. This method updates the whole entryGroups field, so the order is marked as changes and correctly saved to DB.
        Specified by:
        forceOrderSaving in interface EntryGroupService
        Parameters:
        order - order to save
      • getGroupOfType

        public EntryGroup getGroupOfType​(@Nonnull
                                         AbstractOrderModel order,
                                         @Nonnull
                                         java.util.Collection<java.lang.Integer> groupNumbers,
                                         @Nonnull
                                         GroupType type)
        Description copied from interface: EntryGroupService
        Find entry group in the cart by number and type.
        Specified by:
        getGroupOfType in interface EntryGroupService
        Parameters:
        order - user's cart
        groupNumbers - group numbers of the entry
        type - group type
        Returns:
        EntryGroup object or null if no groups of given type in collection
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)