Search in sources :

Example 1 with TrelloList

use of com.intellij.tasks.trello.model.TrelloList in project intellij-community by JetBrains.

the class TrelloRepository method getAvailableTaskStates.

@NotNull
@Override
public Set<CustomTaskState> getAvailableTaskStates(@NotNull Task task) throws Exception {
    final TrelloCard card = fetchCardById(task.getId());
    if (card != null) {
        final List<TrelloList> lists = fetchBoardLists(card.getIdBoard());
        final Set<CustomTaskState> result = new HashSet<>();
        for (TrelloList list : lists) {
            if (!list.getId().equals(card.getIdList())) {
                result.add(new CustomTaskState(list.getId(), list.getName()));
            }
        }
        return result;
    }
    return Collections.emptySet();
}
Also used : TrelloList(com.intellij.tasks.trello.model.TrelloList) TrelloCard(com.intellij.tasks.trello.model.TrelloCard) HashSet(java.util.HashSet) CustomTaskState(com.intellij.tasks.CustomTaskState) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

CustomTaskState (com.intellij.tasks.CustomTaskState)1 TrelloCard (com.intellij.tasks.trello.model.TrelloCard)1 TrelloList (com.intellij.tasks.trello.model.TrelloList)1 HashSet (java.util.HashSet)1 NotNull (org.jetbrains.annotations.NotNull)1