Class SprintUtils
java.lang.Object
com.atlassian.greenhopper.service.sprint.SprintUtils
Utilities to work with and filter Sprint collections
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilter
(List<Sprint> sprints, EnumSet<Sprint.State> states) Filters a list of sprints according to a set of statesstatic com.google.common.base.Predicate
<Sprint> getAllClosedSprintsAfterTheGivenOne
(Sprint checkingSprint) getChangedFieldNames
(Sprint oldSprint, Sprint newSprint) 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 comparatorgetFilteredAndSortedSprints
(EnumSet<Sprint.State> states, Collection<Sprint>... sprintCollections) Gets all board sprints for theto a list of sprints and sorts the sprintsgetFilteredAndSortedSprintsOrderingBy
(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.static Collection
<Sprint> getSprintsForIds
(SprintManager sprintManager, Collection<Long> ids) Converts a list of sprint ids into a list of Sprints.static com.google.common.base.Predicate
<Sprint> getStatesPredicate
(Sprint.State... states) static com.google.common.base.Predicate
<Sprint> getStatesPredicate
(EnumSet<Sprint.State> states)
-
Field Details
-
SPRINT_FUTURE
-
SPRINT_ACTIVE
-
SPRINT_CLOSED
-
SPRINT_NOT_CLOSED
-
-
Constructor Details
-
SprintUtils
public SprintUtils()
-
-
Method Details
-
getStatesPredicate
-
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 includedsprintCollections
- 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 withstates
- the sprint states that should be includedsprintCollections
- 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 includedcomparator
- the comparator used to determine what order the sprints should be placed insprintCollections
- 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
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
-
getAllClosedSprintsAfterTheGivenOne
-