com.atlassian.greenhopper.service.sprint
Class SprintUtils

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

public class SprintUtils
extends java.lang.Object

Utilities to work with and filter Sprint collections


Field Summary
static com.google.common.collect.Ordering<org.joda.time.DateTime> DATE_COMPARATOR
           
static com.google.common.base.Predicate<Sprint> SPRINT_ACTIVE
           
static com.google.common.collect.Ordering<Sprint> SPRINT_BYDATE_COMPARATOR
           
static com.google.common.base.Predicate<Sprint> SPRINT_CLOSED
           
static com.google.common.collect.Ordering<Sprint> SPRINT_END_DATE_COMPARATOR
           
static com.google.common.base.Predicate<Sprint> SPRINT_FUTURE
           
static com.google.common.collect.Ordering<Sprint> SPRINT_ID_COMPARATOR
           
static com.google.common.collect.Ordering<Sprint> SPRINT_NATURAL_COMPARATOR
           
static com.google.common.base.Predicate<Sprint> SPRINT_NOT_CLOSED
           
static com.google.common.collect.Ordering<Sprint> SPRINT_START_DATE_COMPARATOR
           
static com.google.common.collect.Ordering<Sprint> SPRINT_STATE_COMPARATOR
           
static com.google.common.collect.Ordering<Sprint.State> STATE_COMPARATOR
           
 
Constructor Summary
SprintUtils()
           
 
Method Summary
static java.util.List<Sprint> filter(java.util.List<Sprint> sprints, java.util.EnumSet<Sprint.State> states)
          Filters a list of sprints according to a set of states
static java.util.List<Sprint> getFilteredAndSortedSprints(java.util.EnumSet<Sprint.State> states, java.util.Collection<Sprint>... sprintCollections)
          Gets all board sprints for theto a list of sprints and sorts the sprints
static java.util.Collection<Sprint> getSprintsForIds(SprintManager sprintManager, java.util.Collection<java.lang.Long> ids)
          Converts a list of sprint ids into a list of Sprints.
static com.google.common.base.Predicate<Sprint> getStatesPredicate(java.util.EnumSet<Sprint.State> states)
           
static com.google.common.base.Predicate<Sprint> getStatesPredicate(Sprint.State... states)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

DATE_COMPARATOR

public static final com.google.common.collect.Ordering<org.joda.time.DateTime> DATE_COMPARATOR

STATE_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint.State> STATE_COMPARATOR

SPRINT_START_DATE_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint> SPRINT_START_DATE_COMPARATOR

SPRINT_END_DATE_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint> SPRINT_END_DATE_COMPARATOR

SPRINT_ID_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint> SPRINT_ID_COMPARATOR

SPRINT_STATE_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint> SPRINT_STATE_COMPARATOR

SPRINT_BYDATE_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint> SPRINT_BYDATE_COMPARATOR

SPRINT_NATURAL_COMPARATOR

public static final com.google.common.collect.Ordering<Sprint> SPRINT_NATURAL_COMPARATOR
Constructor Detail

SprintUtils

public SprintUtils()
Method Detail

getStatesPredicate

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

getStatesPredicate

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

getFilteredAndSortedSprints

public static java.util.List<Sprint> getFilteredAndSortedSprints(java.util.EnumSet<Sprint.State> states,
                                                                 java.util.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.

filter

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


getSprintsForIds

public static java.util.Collection<Sprint> getSprintsForIds(SprintManager sprintManager,
                                                            java.util.Collection<java.lang.Long> ids)
Converts a list of sprint ids into a list of Sprints. Note: invalid ids are silently ignored!



Copyright © 2007-2014 Atlassian. All Rights Reserved.