Modifier and Type | Method and Description |
---|---|
static <T> T |
only(Iterable<T> iterable)
Returns the only element of an iterable.
|
public static <T> T only(Iterable<T> iterable)
NoSuchElementException
- if this Iterable contains no elements.IllegalStateException
- if this Iterable contains more than one
element.Copyright © 2012-2014 Julian Hyde. All Rights Reserved.