Skip to content

Commit

Permalink
Add missing Javadoc for Iterate.getOnly()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bananeweizen committed Jul 1, 2023
1 parent 8d93d2e commit bc1e763
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3110,6 +3110,11 @@ public static <T> T max(Iterable<T> iterable)
return Iterate.max(iterable, Comparators.naturalOrder());
}

/**
* Returns the only element of a collection.
*
* @throws IllegalArgumentException if the Collection is null, empty, or has more than one element.
*/
public static <T> T getOnly(Iterable<T> iterable)
{
if (iterable != null)
Expand Down

0 comments on commit bc1e763

Please sign in to comment.