| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
contains(Iterable<T> iterable,
T object)
Check whether an iterable contains the given object.
|
static long |
count(Iterable iterable)
Count items in an iterable.
|
static <T> T |
getFirst(Iterable<T> iterable,
String notFoundMessage)
Get the first element from iterable.
|
static <T> T |
getFirst(Iterator<T> iterator,
String notFoundMessage)
Get the first element from iterator.
|
static <T> T |
getFirstOrNull(Iterable<T> iterable)
Get the first element from iterable.
|
static <T> T |
getFirstOrNull(Iterator<T> iterator)
Get the first element from iterator.
|
static <T> T |
getSingle(Iterable<T> iterable)
Get a single element from iterable.
|
static <T> T |
getSingle(Iterable<T> iterable,
String notFoundMessage)
Get a single element from iterable.
|
static <T> T |
getSingle(Iterator<T> iterator)
Get a single element from iterator.
|
static <T> T |
getSingle(Iterator<T> iterator,
String notFoundMessage)
Get a single element from iterator.
|
static <T> T |
getSingleOrNull(Iterable<T> iterable)
Get a single element from iterable.
|
static <T> T |
getSingleOrNull(Iterator<T> iterator)
Get a single element from iterator.
|
static <T> List<T> |
toList(Iterable<T> iterable)
Convert an iterable to a list.
|
public static long count(Iterable iterable)
iterable - to count items in.public static <T> boolean contains(Iterable<T> iterable, T object)
T - type of the objects stored in the iterable.iterable - to check in.object - to look for.public static <T> List<T> toList(Iterable<T> iterable)
T - type of the items held.iterable - to convert.public static <T> T getSingle(Iterator<T> iterator, String notFoundMessage)
T - type of the element.iterator - to find a single element.notFoundMessage - exception message if there are no elements.org.neo4j.ogm.exception.core.NotFoundException - in case there are no elements.IllegalStateException - in case the iterable contains more than 1 element.public static <T> T getSingle(Iterable<T> iterable, String notFoundMessage)
T - type of the element.iterable - to find a single element.notFoundMessage - exception message if there are no elements.org.neo4j.ogm.exception.core.NotFoundException - in case there are no elements.IllegalStateException - in case the iterable contains more than 1 element.public static <T> T getSingle(Iterator<T> iterator)
T - type of the element.iterator - to find a single element.org.neo4j.ogm.exception.core.NotFoundException - in case there are no elements.IllegalStateException - in case the iterable contains more than 1 element.public static <T> T getSingle(Iterable<T> iterable)
T - type of the element.iterable - to find a single element.org.neo4j.ogm.exception.core.NotFoundException - in case there are no elements.IllegalStateException - in case the iterable contains more than 1 element.public static <T> T getSingleOrNull(Iterator<T> iterator)
T - type of the element.iterator - to find a single element.IllegalStateException - in case the iterable contains more than 1 element.public static <T> T getSingleOrNull(Iterable<T> iterable)
T - type of the element.iterable - to find a single element.IllegalStateException - in case the iterable contains more than 1 element.public static <T> T getFirst(Iterator<T> iterator, String notFoundMessage)
T - type of the element.iterator - to find the first element.notFoundMessage - exception message if there are no elements.org.neo4j.ogm.exception.core.NotFoundException - in case there are no elements.public static <T> T getFirst(Iterable<T> iterable, String notFoundMessage)
T - type of the element.iterable - to find the first element.notFoundMessage - exception message if there are no elements.org.neo4j.ogm.exception.core.NotFoundException - in case there are no elements.public static <T> T getFirstOrNull(Iterator<T> iterator)
T - type of the element.iterator - to find the first element.public static <T> T getFirstOrNull(Iterable<T> iterable)
T - type of the element.iterable - to find the first element.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.