Class SortBean

java.lang.Object
mc.core.system.base.BaseBean
mc.core.domain.base.aspect.SortBean

public class SortBean extends mc.core.system.base.BaseBean
CDI-helper class to provide methods to sort entities within list, either step by step up or down, or moving them to the specified position. In addition handles storing and reading independent sort order that an entity may have for a set of attributes. To date this is used to create an individual sort order of inherited and own attributes per child entity.
  • Method Details

    • changeOrderOfAssignedObjectInAssignmentList

      public void changeOrderOfAssignedObjectInAssignmentList(IEntity entity, boolean decreaseOrder, List<? extends IObjectAssignment> assignedObjectList)
      changes place of assignment of given entity in List of IObjectAssignment. Moves it one place up if @param decreaseOrder false, otherwise one place down.
    • changeOrderOfAssignedObjectInAssignmentList

      public void changeOrderOfAssignedObjectInAssignmentList(IEntity entity, int targetPosition, List<? extends IObjectAssignment> assignedObjectList)
      Changes place of given entity to targetPosition in list of assigned entities.
      Parameters:
      sortable - mandatory entity of which the assignment should be moved within list to targetPosition. There must be an IObjectAssignment holding this entity in given list
      sortList - mandatory, list of entities to sort persistently by setting prio of all members after sorting to mirror new sort order. Prios starting with 1.
      targetPosition - position which given entity should be in after sort, positions in list start with 1. Target position can be smaller or bigger than current position, if equal, nothing happens.