Class ResolvingAggregateReference<T,ID>
java.lang.Object
org.springframework.data.rest.core.ResolvingAggregateReference<T,ID>
- All Implemented Interfaces:
AggregateReference<T,
ID>
An
AggregateReference
implementation that resolves the source URI given a Function
or into a fixed
value.- Since:
- 4.1
- Author:
- Oliver Drotbohm
-
Constructor Summary
ModifierConstructorDescriptionResolvingAggregateReference
(URI source, Function<Object, ? extends T> aggregateResolver, Function<Object, ? extends ID> identifierResolver) Creates a newResolvingAggregateReference
for the givenURI
to eventually resolve the final value against the given resolver function.protected
ResolvingAggregateReference
(URI source, Function<Object, ? extends T> aggregateResolver, Function<Object, ? extends ID> identifierResolver, Function<URI, ? extends Object> extractor) ResolvingAggregateReference
(URI source, T value, ID identifier) Creates a newResolvingAggregateReference
for the givenURI
resolving in the given fixed value. -
Method Summary
Modifier and TypeMethodDescriptiongetUri()
Returns the sourceURI
.Resolves the underlying URI into a full aggregate, potentially applying the configured identifier extractor.Resolves the underlying URI into an aggregate identifier, potentially applying the registered identifier extractor.withIdSource
(Function<UriComponents, Object> extractor) Creates a newAggregateReference
resolving the identifier source value from the givenUriComponents
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.rest.core.AggregateReference
resolveRequiredAggregate, resolveRequiredId
-
Constructor Details
-
ResolvingAggregateReference
public ResolvingAggregateReference(URI source, Function<Object, ? extends T> aggregateResolver, Function<Object, ? extends ID> identifierResolver) Creates a newResolvingAggregateReference
for the givenURI
to eventually resolve the final value against the given resolver function.- Parameters:
source
- must not be null.aggregateResolver
- must not be null.identifierResolver
- must not be null.
-
ResolvingAggregateReference
-
ResolvingAggregateReference
Creates a newResolvingAggregateReference
for the givenURI
resolving in the given fixed value. Primarily for testing purposes.- Parameters:
source
- must not be null.value
- can be null.identifier
- must not be null.
-
-
Method Details
-
getUri
Description copied from interface:AggregateReference
Returns the sourceURI
.- Specified by:
getUri
in interfaceAggregateReference<T,
ID> - Returns:
- will never be null.
-
resolveId
Description copied from interface:AggregateReference
Resolves the underlying URI into an aggregate identifier, potentially applying the registered identifier extractor.- Specified by:
resolveId
in interfaceAggregateReference<T,
ID> - Returns:
- can be null.
- See Also:
-
resolveAggregate
Description copied from interface:AggregateReference
Resolves the underlying URI into a full aggregate, potentially applying the configured identifier extractor.- Specified by:
resolveAggregate
in interfaceAggregateReference<T,
ID> - Returns:
- can be null.
- See Also:
-
withIdSource
Description copied from interface:AggregateReference
Creates a newAggregateReference
resolving the identifier source value from the givenUriComponents
.- Specified by:
withIdSource
in interfaceAggregateReference<T,
ID> - Parameters:
extractor
- must not be null.- Returns:
- will never be null.
-