All Methods Static Methods Concrete Methods
Modifier and Type |
Method |
Description |
static <T> Optional<T> |
atMostOne(Collection<T> objects) |
Returns the object in the Collection wrapped in an Optional , an empty Optional if the collection
is empty, throwing an Exception if the Collection contains more than one element.
|
static <T> T |
exactlyOne(Collection<T> objects) |
Returns the element in the Collection , throwing an exception if the collection is empty or contains more
than one element.
|
static <T> T |
require(Optional<T> required) |
Returns the object contained in the specified Optional , throwing an Exception if it is empty.
|
static void |
setBindings(Operation operation,
Map<String,Value> bindings) |
|
static <T> Collector<T,?,T> |
toSingleton() |
Returns the element in the Stream , throwing an exception if the stream is empty or
contains more than one element.
|
static <T> Collector<T,?,T> |
toSingletonMaybe() |
Returns the element in the Stream , or null if the stream is empty, throwing an exception
if the stream contains more than one element.
|
static <T> Collector<T,?,Optional<T>> |
toSingletonOptional() |
Returns the element in the Stream wrapped in an Optional throwing an exception
if the stream contains more than one element.
|