Class OperationUtils
java.lang.Object
org.eclipse.rdf4j.spring.dao.support.operation.OperationUtils
- Since:
- 4.0.0
- Author:
- Florian Kleedorfer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<T>atMostOne(Collection<T> objects) Returns the object in theCollectionwrapped in anOptional, an empty Optional if the collection is empty, throwing an Exception if the Collection contains more than one element.static <T> TexactlyOne(Collection<T> objects) Returns the element in theCollection, throwing an exception if the collection is empty or contains more than one element.static <T> TReturns the object contained in the specifiedOptional, throwing an Exception if it is empty.static voidsetBindings(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 theCollectionwrapped in anOptional, an empty Optional if the collection is empty, throwing an Exception if the Collection contains more than one element. -
require
Returns the object contained in the specifiedOptional, throwing an Exception if it is empty. -
exactlyOne
Returns the element in theCollection, throwing an exception if the collection is empty or contains more than one element. -
toSingleton
Returns the element in theStream, throwing an exception if the stream is empty or contains more than one element. -
toSingletonMaybe
Returns the element in theStream, or null if the stream is empty, throwing an exception if the stream contains more than one element. -
toSingletonOptional
-
setBindings
-