Class SprintUtils

java.lang.Object
com.atlassian.greenhopper.service.sprint.SprintUtils

public class SprintUtils extends Object
Utilities to work with and filter Sprint collections
  • Field Details

    • SPRINT_FUTURE

      public static final com.google.common.base.Predicate<Sprint> SPRINT_FUTURE
    • SPRINT_ACTIVE

      public static final com.google.common.base.Predicate<Sprint> SPRINT_ACTIVE
    • SPRINT_CLOSED

      public static final com.google.common.base.Predicate<Sprint> SPRINT_CLOSED
    • SPRINT_NOT_CLOSED

      public static final com.google.common.base.Predicate<Sprint> SPRINT_NOT_CLOSED
  • Constructor Details

    • SprintUtils

      public SprintUtils()
  • Method Details

    • getStatesPredicate

      public static com.google.common.base.Predicate<Sprint> getStatesPredicate(Sprint.State... states)
    • getStatesPredicate

      public static com.google.common.base.Predicate<Sprint> getStatesPredicate(EnumSet<Sprint.State> states)
    • getFilteredAndSortedSprints

      public static List<Sprint> getFilteredAndSortedSprints(EnumSet<Sprint.State> states, Collection<Sprint>... sprintCollections)
      Gets all board sprints for theto a list of sprints and sorts the sprints
      Parameters:
      states - the sprint states that should be included
      sprintCollections - collections of sprints to merge
      Returns:
      a sorted list of all rapid view sprints and the passed in sprints in order of ID descending.
    • getFilteredAndSortedSprints

      public static List<Sprint> getFilteredAndSortedSprints(com.google.common.collect.Ordering<Sprint> comparator, EnumSet<Sprint.State> states, Collection<Sprint>... sprintCollections)
      Gets all board sprints and passed in sprints and sorts the sprints in order dictated by the given comparator
      Parameters:
      comparator - comparator to sort with
      states - the sprint states that should be included
      sprintCollections - collections of sprints to merge
      Returns:
      a sorted list of all rapid view sprints and the passed in sprints in order of date descending.
    • getFilteredAndSortedSprintsOrderingBy

      public static List<Sprint> getFilteredAndSortedSprintsOrderingBy(EnumSet<Sprint.State> states, com.google.common.collect.Ordering<Sprint> comparator, Collection<Sprint>... sprintCollections)
      Gets all board sprints and passed in sprints and sorts the sprints based on a paramater in the method call.
      Parameters:
      states - the sprint states that should be included
      comparator - the comparator used to determine what order the sprints should be placed in
      sprintCollections - collections of sprints to merge
      Returns:
      a sorted list of all rapid view sprints and the passed in sprints in order specified in the method call
    • filter

      public static List<Sprint> filter(List<Sprint> sprints, EnumSet<Sprint.State> states)
      Filters a list of sprints according to a set of states
    • getSprintsForIds

      public static Collection<Sprint> getSprintsForIds(SprintManager sprintManager, Collection<Long> ids)
      Converts a list of sprint ids into a list of Sprints.

      Note: invalid ids are silently ignored!

    • getChangedFieldNames

      public static Set<String> getChangedFieldNames(Sprint oldSprint, Sprint newSprint)
    • getAllClosedSprintsAfterTheGivenOne

      public static com.google.common.base.Predicate<Sprint> getAllClosedSprintsAfterTheGivenOne(Sprint checkingSprint)