java.lang.Object
org.neo4j.ogm.support.CollectionUtils
Utilities around collections.
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptioniterableOf(Object thingToIterable) TurnsthingToIterableinto an iterable.static ObjectmaterializeIterableIf(Object entryValue)
-
Method Details
-
iterableOf
TurnsthingToIterableinto an iterable. In case of null, it returns an empty collection. Returns the iterable itself when the thing is already iterable. An array will be turned into an iterable. A single object will be returned as a singleton list.- Parameters:
thingToIterable- A thing that should be iterated over. Can be null.- Returns:
- An iterable.
-
materializeIterableIf
- Parameters:
entryValue- A value that is needed as a collection.- Returns:
- Returns a collection if
entryValueis iterable but not already a collection.
-