public abstract class Expectations extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
any(Collection<T> candidates,
com.google.common.base.Predicate<T> condition)
Deprecated.
|
static <T> com.google.common.base.Optional<T> |
noneOrOne(Iterable<T> values)
gives none if empty, one if one element, fails if more than one
|
static <T> com.google.common.base.Optional<T> |
noneOrOne(Iterator<T> iterator)
gives none if empty, one if one element, fails if more than one
|
static <T> com.google.common.base.Optional<T> |
noneOrOneIfOnlyOne(Iterable<T> values)
gives one, if only one value exist
gives none on everything else
|
static <T> com.google.common.base.Optional<T> |
noneOrOneIfOnlyOne(Iterator<T> iterator)
gives one, if only one value exist
gives none on everything else
|
static <T> T |
oneIfOnlyOne(Iterable<T> values,
T defaultValue)
gives first value, if one value exist
gives defaultValue if empty or more than one value exist,
|
static <T> T |
oneIfOnlyOne(Iterator<T> iterator,
T defaultValue)
gives first value, if one value exist
gives defaultValue if empty or more than one value exist,
|
public static <T> com.google.common.base.Optional<T> noneOrOneIfOnlyOne(Iterator<T> iterator)
values - public static <T> com.google.common.base.Optional<T> noneOrOneIfOnlyOne(Iterable<T> values)
values - public static <T> T oneIfOnlyOne(Iterator<T> iterator, T defaultValue)
values - public static <T> T oneIfOnlyOne(Iterable<T> values, T defaultValue)
values - public static <T> com.google.common.base.Optional<T> noneOrOne(Iterator<T> iterator)
values - IllegalArgumentException - if more than one value existpublic static <T> com.google.common.base.Optional<T> noneOrOne(Iterable<T> values)
values - IllegalArgumentException - if more than one value exist@Deprecated public static <T> boolean any(Collection<T> candidates, com.google.common.base.Predicate<T> condition)
Iterables.any(Iterable, Predicate)Copyright © 2014. All Rights Reserved.