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
ConstructorsModifierConstructorDescriptionResolvingAggregateReference(URI source, @Nullable T value, ID identifier) Creates a newResolvingAggregateReferencefor the givenURIresolving in the given fixed value.ResolvingAggregateReference(URI source, Function<Object, ? extends T> aggregateResolver, Function<Object, ? extends ID> identifierResolver) Creates a newResolvingAggregateReferencefor the givenURIto eventually resolve the final value against the given resolver function.protectedResolvingAggregateReference(URI source, Function<Object, ? extends T> aggregateResolver, Function<Object, ? extends ID> identifierResolver, Function<URI, ? extends Object> extractor) -
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 newAggregateReferenceresolving the identifier source value from the givenUriComponents.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 newResolvingAggregateReferencefor the givenURIto 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 newResolvingAggregateReferencefor the givenURIresolving 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:AggregateReferenceReturns the sourceURI.- Specified by:
getUriin interfaceAggregateReference<T,ID> - Returns:
- will never be null.
-
resolveId
Description copied from interface:AggregateReferenceResolves the underlying URI into an aggregate identifier, potentially applying the registered identifier extractor.- Specified by:
resolveIdin interfaceAggregateReference<T,ID> - Returns:
- can be null.
- See Also:
-
resolveAggregate
Description copied from interface:AggregateReferenceResolves the underlying URI into a full aggregate, potentially applying the configured identifier extractor.- Specified by:
resolveAggregatein interfaceAggregateReference<T,ID> - Returns:
- can be null.
- See Also:
-
withIdSource
Description copied from interface:AggregateReferenceCreates a newAggregateReferenceresolving the identifier source value from the givenUriComponents.- Specified by:
withIdSourcein interfaceAggregateReference<T,ID> - Parameters:
extractor- must not be null.- Returns:
- will never be null.
-