Package org.cyclos.impl.users
Class GroupListView<T extends BasicGroup,VO extends BasicGroupVO>
- java.lang.Object
-
- org.cyclos.impl.users.GroupListView<T,VO>
-
- Type Parameters:
T- the type of the groups contained in this listVO- the type of the elements in the sorted hierarchy
- All Implemented Interfaces:
Iterable<T>
public class GroupListView<T extends BasicGroup,VO extends BasicGroupVO> extends Object implements Iterable<T>
View for a set of groups. The contained items or a sorted hierarchy can be obtained from this class.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(Collection<BasicGroupVO> selection)Ensure all groups in the given selection are contained in the group list.booleancontainsAny(BasicGroup... elements)Returns true if this view contains at least on of the given elements.Set<VO>defaultFilter()booleanisEmpty()booleanisNotEmpty()Set<T>items()Iterator<T>iterator()static <T extends BasicGroup,VO extends BasicGroupVO>
GroupListView<T,VO>of(GroupsHandlerInternal groupsHandler, boolean overBrokered, Set<T> groups)Factory method.List<VO>sorted()Stream<T>stream()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
of
public static <T extends BasicGroup,VO extends BasicGroupVO> GroupListView<T,VO> of(GroupsHandlerInternal groupsHandler, boolean overBrokered, Set<T> groups)
Factory method. The set of groups must be already flattened (i.e including the groups if necessary)
-
check
public void check(Collection<BasicGroupVO> selection) throws PermissionDeniedException
Ensure all groups in the given selection are contained in the group list. If the list and the selected are both empty then it returns silently. This method must be used in the security layer to check the group filters used in a query.- Throws:
PermissionDeniedException- if at least one selected groups is not contained in the list.
-
containsAny
public boolean containsAny(BasicGroup... elements)
Returns true if this view contains at least on of the given elements.
-
isEmpty
public boolean isEmpty()
-
isNotEmpty
public boolean isNotEmpty()
-
iterator
public Iterator<T> iterator()
- Specified by:
iteratorin interfaceIterable<T extends BasicGroup>
-
-