Class OperationUtils
java.lang.Object
org.eclipse.rdf4j.spring.dao.support.operation.OperationUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional
<T> atMostOne
(Collection<T> objects) Returns the object in theCollection
wrapped in anOptional
, 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 theCollection
, throwing an exception if the collection is empty or contains more than one element.static <T> T
Returns the object contained in the specifiedOptional
, throwing an Exception if it is empty.static void
setBindings
(Operation operation, Map<String, Value> bindings) static <T> Collector
<T, ?, T> Returns the element in theStream
, throwing an exception if the stream is empty or contains more than one element.static <T> Collector
<T, ?, T> Returns the element in theStream
, or null if the stream is empty, throwing an exception if the stream contains more than one element.
-
Constructor Details
-
OperationUtils
public OperationUtils()
-
-
Method Details
-
atMostOne
Returns the object in theCollection
wrapped in anOptional
, an empty Optional if the collection is empty, throwing an Exception if the Collection contains more than one element. -
require
-
exactlyOne
Returns the element in theCollection
, throwing an exception if the collection is empty or contains more than one element. -
toSingleton
-
toSingletonMaybe
-
toSingletonOptional
-
setBindings
-