jetbrains.buildServer.util
Class NamedDataGroup<Item>

java.lang.Object
  extended by jetbrains.buildServer.util.NamedDataGroup<Item>
Direct Known Subclasses:
TestGroup

public class NamedDataGroup<Item>
extends java.lang.Object

This class was created to represent a hierarchical group of items.

Since:
4.5
Author:
kir

Nested Class Summary
static interface NamedDataGroup.GroupExtractor<Item>
          When grouping items, extract group from Item.
 
Constructor Summary
NamedDataGroup(java.lang.String name)
           
 
Method Summary
 void addGroup(NamedDataGroup<Item> group)
          Add child group
 void addItem(Item item)
          Add child item
 java.util.List<? extends NamedDataGroup<Item>> getGroups()
           
 java.util.List<Item> getItems()
           
 java.lang.String getName()
           
 NamedDataGroup<Item> getParent()
           
 void groupBy(NamedDataGroup.GroupExtractor<Item> groupNameExtractor)
          Create sub-groups in this TestGroup from the containing tests using given strategy to extract groups from tests
 void removeGroup(NamedDataGroup<Item> group)
          Remove child group
 void setGroups(java.util.List<NamedDataGroup<Item>> groups)
          Set child groups
 void setItems(java.util.List<Item> items)
          Set child items for the group
 void setParent(NamedDataGroup<Item> parent)
          Set parent group
 void sortGroups(java.util.Comparator<NamedDataGroup<Item>> sorter)
          Sort groups according to given sorter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedDataGroup

public NamedDataGroup(@NotNull
                      java.lang.String name)
Parameters:
name - name for the group
Method Detail

getName

@NotNull
public java.lang.String getName()
Returns:
name of the group

getItems

@NotNull
public java.util.List<Item> getItems()

getGroups

@NotNull
public java.util.List<? extends NamedDataGroup<Item>> getGroups()
Returns:
list of child groups (includes a group with own items, this group has an empty name)

getParent

@Nullable
public NamedDataGroup<Item> getParent()
Returns:
parent group (if one exists) or null for a root group

setParent

public void setParent(NamedDataGroup<Item> parent)
Set parent group

Parameters:
parent - parent group for this one

addGroup

public void addGroup(NamedDataGroup<Item> group)
Add child group

Parameters:
group - group to be added

removeGroup

public void removeGroup(NamedDataGroup<Item> group)
Remove child group

Parameters:
group - group to be removed

addItem

public void addItem(Item item)
Add child item

Parameters:
item - item to be added

setItems

public void setItems(@NotNull
                     java.util.List<Item> items)
Set child items for the group

Parameters:
items - child items

setGroups

public void setGroups(java.util.List<NamedDataGroup<Item>> groups)
Set child groups

Parameters:
groups - child groups

groupBy

public void groupBy(@NotNull
                    NamedDataGroup.GroupExtractor<Item> groupNameExtractor)
Create sub-groups in this TestGroup from the containing tests using given strategy to extract groups from tests

Parameters:
groupNameExtractor - strategy to extract group name from the test name
Since:
6.5

sortGroups

public void sortGroups(java.util.Comparator<NamedDataGroup<Item>> sorter)
Sort groups according to given sorter

Parameters:
sorter - sorter for the groups
Since:
6.5