|
||||||||||
| 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
Factories and utilities pertaining to the Constraint interface.
Constraints and collections returned by this class are serializable.
MapConstraints| Field Summary | |
|---|---|
static Constraint<java.lang.Object> |
NOT_NULL
A constraint that verifies that the element is not null. |
| Method Summary | ||
|---|---|---|
static
|
constrainedCollection(java.util.Collection<E> collection,
Constraint<? super E> constraint)
Returns a constrained view of the specified collection, using the specified constraint. |
|
static
|
constrainedList(java.util.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(java.util.Set<E> set,
Constraint<? super E> constraint)
Returns a constrained view of the specified set, using the specified constraint. |
|
static
|
constrainedSortedSet(java.util.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<java.lang.Object> NOT_NULL
NullPointerException is thrown.
| Method Detail |
|---|
public static <E> java.util.Collection<E> constrainedCollection(java.util.Collection<E> collection,
Constraint<? super E> constraint)
collection - the collection to constrainconstraint - the constraint that validates added elements
public static <E> java.util.Set<E> constrainedSet(java.util.Set<E> set,
Constraint<? super E> constraint)
set - the set to constrainconstraint - the constraint that validates added elements
public static <E> java.util.SortedSet<E> constrainedSortedSet(java.util.SortedSet<E> sortedSet,
Constraint<? super E> constraint)
sortedSet - the sorted set to constrainconstraint - the constraint that validates added elements
public static <E> java.util.List<E> constrainedList(java.util.List<E> list,
Constraint<? super E> constraint)
If list implements RandomAccess, so will the returned
list.
list - the list to constrainconstraint - the constraint that validates added elements
public static <E> Multiset<E> constrainedMultiset(Multiset<E> multiset,
Constraint<? super E> constraint)
multiset - the multiset to constrainconstraint - the constraint that validates added elements
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||