|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.common.collect.Constraints
public final class Constraints
Factory and utilities pertaining to the Constraint interface.
Constraint and Collection instances returned by this class
are serializable.
MapConstraints| Field Summary | |
|---|---|
static Constraint<Object> |
NOT_NULL
A constraint that verifies that the element is not null. |
| Method Summary | ||
|---|---|---|
static
|
constrainedCollection(Collection<E> collection,
Constraint<? super E> constraint)
Returns a constrained view of the specified collection, using the specified constraint. |
|
static
|
constrainedList(List<E> list,
Constraint<? super E> constraint)
Returns a constrained view of the specified list, using the specified constraint. |
|
static
|
constrainedMultiset(Multiset<E> multiset,
Constraint<? super E> constraint)
Returns a constrained view of the specified multiset, using the specified constraint. |
|
static
|
constrainedSet(Set<E> set,
Constraint<? super E> constraint)
Returns a constrained view of the specified set, using the specified constraint. |
|
static
|
constrainedSortedSet(SortedSet<E> sortedSet,
Constraint<? super E> constraint)
Returns a constrained view of the specified sorted set, using the specified constraint. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Constraint<Object> NOT_NULL
NullPointerException is thrown.
| Method Detail |
|---|
public static <E> Collection<E> constrainedCollection(Collection<E> collection,
Constraint<? super E> constraint)
collection - the collection for which to return a constrained viewconstraint - the constraint for elements in the collection
public static <E> Set<E> constrainedSet(Set<E> set,
Constraint<? super E> constraint)
set - the set for which to return a constrained viewconstraint - the constraint for elements in the set
public static <E> SortedSet<E> constrainedSortedSet(SortedSet<E> sortedSet,
Constraint<? super E> constraint)
sortedSet - the sorted set for which to return a constrained viewconstraint - the constraint for elements in the sorted set
public static <E> List<E> constrainedList(List<E> list,
Constraint<? super E> constraint)
If list implements RandomAccess, so will the returned
list.
list - the list for which to return a constrained viewconstraint - the constraint for elements in the list
public static <E> Multiset<E> constrainedMultiset(Multiset<E> multiset,
Constraint<? super E> constraint)
multiset - the multiset for which to return a constrained viewconstraint - the constraint for elements in the multiset
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||