Schnittstelle EmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>
- Typparameter:
ResourceT- the type of the object being wrapped, which contains the main dataEmbeddedT- the type of the object representing additional embedded resources related to the main data, if any
- Alle Superschnittstellen:
SealedEmbeddedLinkAssemblerModule<EmbeddedT>,SealedNonReactiveEmbeddingHalWrapperAssembler<ResourceT,,EmbeddedT> SealedResourceLinkAssemblerModule<ResourceT>,SealedResourceListAssemblerModule<ResourceT,EmbeddedT>
While the interface's main focus is the transformation of reactive streams, it also comes equipped with the means to transform in an imperative manner, i.e., with direct objects and, for example, lists.
Core functionalities include:
- Enhancing streams of main resources and their embedded resources to meet HAL structure requirements reactively.
- Appending hypermedia links to resources within the stream to support navigability and resource interaction in a HAL-based API reactively.
- Enabling custom naming and linking definitions for collections of embedded resources through reactive implementation.
- Supporting pagination and backpressure in reactive streams when wrapping resources to provide structured navigation across large datasets.
- Siehe auch:
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdefault reactor.core.publisher.Mono<HalListWrapper<ResourceT, EmbeddedT>> wrapInListWrapper(MultiRightPairFlux<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapper, enhancing them with hypermedia links as defined by the assembler.default reactor.core.publisher.Mono<HalListWrapper<ResourceT, EmbeddedT>> wrapInListWrapper(MultiRightPairFlux<ResourceT, EmbeddedT> resourcesToWrap, reactor.core.publisher.Mono<Long> totalElements, int pageSize, Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapperwith pagination details.default reactor.core.publisher.Mono<HalListWrapper<ResourceT, EmbeddedT>> wrapInListWrapper(PairFlux<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapper, enhancing them with hypermedia links as defined by the assembler.default reactor.core.publisher.Mono<HalListWrapper<ResourceT, EmbeddedT>> wrapInListWrapper(PairFlux<ResourceT, EmbeddedT> resourcesToWrap, reactor.core.publisher.Mono<Long> totalElements, int pageSize, Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapperwith pagination details.default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT, EmbeddedT>> wrapInResourceWrapper(reactor.core.publisher.Mono<ResourceT> resourceToWrap, Class<EmbeddedT> embeddedTypeAsNameOrigin, reactor.core.publisher.Flux<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof an resource and aFluxof its associated embedded resources into aHalResourceWrapper, appending hypermedia links as defined by the assembler.default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT, EmbeddedT>> wrapInResourceWrapper(reactor.core.publisher.Mono<ResourceT> resourceToWrap, String embeddedListName, reactor.core.publisher.Flux<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof an resource and aFluxof its associated embedded resources into aHalResourceWrapper, appending hypermedia links as defined by the assembler.default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT, EmbeddedT>> wrapInResourceWrapper(reactor.core.publisher.Mono<ResourceT> resourceWrap, reactor.core.publisher.Flux<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof a resource and a non-emptyFluxof its embedded resources into aHalResourceWrapper, appending hypermedia links as defined by the assembler.default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT, EmbeddedT>> wrapInResourceWrapper(reactor.core.publisher.Mono<ResourceT> resourceToWrap, reactor.core.publisher.Mono<EmbeddedT> embedded, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof a resource and its associated embedded resource into aHalResourceWrapper, enhancing both with hypermedia links as defined by the assembler.Von Schnittstelle geerbte Methoden de.kamillionlabs.hateoflux.assembler.SealedEmbeddedLinkAssemblerModule
buildLinksForEmbedded, buildOtherLinksForEmbedded, buildSelfLinkForEmbeddedVon Schnittstelle geerbte Methoden de.kamillionlabs.hateoflux.assembler.SealedNonReactiveEmbeddingHalWrapperAssembler
getEmbeddedTClass, wrapInListWrapper, wrapInListWrapper, wrapInListWrapper, wrapInListWrapper, wrapInListWrapper, wrapInListWrapper, wrapInResourceWrapper, wrapInResourceWrapper, wrapInResourceWrapper, wrapInResourceWrapperVon Schnittstelle geerbte Methoden de.kamillionlabs.hateoflux.assembler.SealedResourceLinkAssemblerModule
buildLinksForResource, buildOtherLinksForResource, buildSelfLinkForResourceVon Schnittstelle geerbte Methoden de.kamillionlabs.hateoflux.assembler.SealedResourceListAssemblerModule
buildLinksForResourceList, buildLinksForResourceList, buildOtherLinksForResourceList, buildSelfLinkForResourceList, createEmptyListWrapper, createEmptyListWrapper, createEmptyListWrapper, createEmptyListWrapper, getResourceTClass
-
Methodendetails
-
wrapInListWrapper
default reactor.core.publisher.Mono<HalListWrapper<ResourceT,EmbeddedT>> wrapInListWrapper(@NonNull MultiRightPairFlux<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapper, enhancing them with hypermedia links as defined by the assembler.The embedded resources (list) for a main resource i.e. the list with the right elements of the
MultiRightPairFlux, is allowed to be empty or null resulting in either the removal of the_embeddednode or the addition of an empty array in the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the reactive stream of resources and their associated embedded resources to be wrappedexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalListWrappercontaining the resources enhanced with hypermedia links - Siehe auch:
-
wrapInListWrapper
default reactor.core.publisher.Mono<HalListWrapper<ResourceT,EmbeddedT>> wrapInListWrapper(@NonNull MultiRightPairFlux<ResourceT, EmbeddedT> resourcesToWrap, @NonNull reactor.core.publisher.Mono<Long> totalElements, int pageSize, @Nullable Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapperwith pagination details. This includes hypermedia links as defined by the assembler, along with pagination parameters.The embedded resources (list) for a main resource i.e. the list with the right elements of the
MultiRightPairFlux, is allowed to be empty or null resulting in either the removal of the_embeddednode or the addition of an empty array in the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the reactive stream of resources and their associated embedded resources to be wrappedtotalElements- aMonoproviding the total number of elements across all pagespageSize- the number of items per pageoffset- the starting offset of the page, if specifiedsortCriteria- sort criteria (property and direction) of the pageexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalListWrappercontaining the paginated list of resources enhanced with hypermedia links - Siehe auch:
-
wrapInListWrapper
default reactor.core.publisher.Mono<HalListWrapper<ResourceT,EmbeddedT>> wrapInListWrapper(@NonNull PairFlux<ResourceT, EmbeddedT> resourcesToWrap, @NonNull reactor.core.publisher.Mono<Long> totalElements, int pageSize, @Nullable Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapperwith pagination details. This includes hypermedia links as defined by the assembler, along with pagination parameters.The embedded resources in the
PairFluxare allowed to be null resulting in the removal of the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the reactive stream of resources and their associated embedded resources to be wrappedtotalElements- areactor.core.publisher.Mono<Long>providing the total number of elements across all pagespageSize- the number of items per pageoffset- the starting offset of the page, if specifiedsortCriteria- sort criteria (property and direction) of the pageexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalListWrappercontaining the paginated list of resources enhanced with hypermedia links - Siehe auch:
-
wrapInListWrapper
default reactor.core.publisher.Mono<HalListWrapper<ResourceT,EmbeddedT>> wrapInListWrapper(@NonNull PairFlux<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactive stream of resource pairs into aMonoof aHalListWrapper, enhancing them with hypermedia links as defined by the assembler.The embedded resources in the
PairFluxare allowed to be null resulting in the removal of the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the reactive stream of resources and their associated embedded resources to be wrappedexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalListWrappercontaining the resources enhanced with hypermedia links - Siehe auch:
-
wrapInResourceWrapper
default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT,EmbeddedT>> wrapInResourceWrapper(@NonNull reactor.core.publisher.Mono<ResourceT> resourceToWrap, @NonNull reactor.core.publisher.Mono<EmbeddedT> embedded, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof a resource and its associated embedded resource into aHalResourceWrapper, enhancing both with hypermedia links as defined by the assembler.If
resourceToWrapis empty, the result will also be an emptyMono. If theembeddedis empty, when serialized, the resulting JSON will not have an_embeddednode.- Parameter:
resourceToWrap- theMonoof the resource to be wrappedembedded- theMonoof the associated embedded resourceexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalResourceWrappercontaining the wrapped resource and embedded resource, enhanced with hypermedia links - Siehe auch:
-
wrapInResourceWrapper
default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT,EmbeddedT>> wrapInResourceWrapper(@NonNull reactor.core.publisher.Mono<ResourceT> resourceWrap, @NonNull reactor.core.publisher.Flux<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof a resource and a non-emptyFluxof its embedded resources into aHalResourceWrapper, appending hypermedia links as defined by the assembler.If
resourceToWrapis empty, the result will also be an emptyMono. If theembeddedis empty, when serialized, the resulting JSON will have an empty array in the_embeddednode.- Parameter:
resourceWrap- theMonoof the main resource to wrapembeddedList- theFluxof embedded resources associated with the main resource; this list must not be empty. The list name is derived from the embedded resource's class name (see alsoRelation)exchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalResourceWrapperthat includes the main resource and its embedded resources, all enhanced with hypermedia links - Löst aus:
IllegalArgumentException- if the embedded list is null or empty- Siehe auch:
-
wrapInResourceWrapper
default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT,EmbeddedT>> wrapInResourceWrapper(@NonNull reactor.core.publisher.Mono<ResourceT> resourceToWrap, @NonNull String embeddedListName, @NonNull reactor.core.publisher.Flux<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof an resource and aFluxof its associated embedded resources into aHalResourceWrapper, appending hypermedia links as defined by the assembler. The list is identified by a directly provided list name. The flux may be empty.If
resourceToWrapis empty, the result will also be an emptyMono. If theembeddedis empty, when serialized, the resulting JSON will have an empty array in the_embeddednode.- Parameter:
resourceToWrap- theMonoof the main resource to wrapembeddedListName- the explicitly provided name for the list of embedded resourcesembeddedList- theFluxof embedded resources associated with the main resource, which may be emptyexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalResourceWrapperthat includes the main resource and its named list of embedded resources, all enhanced with hypermedia links - Siehe auch:
-
wrapInResourceWrapper
default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT,EmbeddedT>> wrapInResourceWrapper(@NonNull reactor.core.publisher.Mono<ResourceT> resourceToWrap, @NonNull Class<EmbeddedT> embeddedTypeAsNameOrigin, @NonNull reactor.core.publisher.Flux<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a reactiveMonoof an resource and aFluxof its associated embedded resources into aHalResourceWrapper, appending hypermedia links as defined by the assembler. The list name is derived from the specified classembeddedTypeAsNameOrigin. The list may be empty.If
resourceToWrapis empty, the result will also be an emptyMono. If theembeddedis empty, when serialized, the resulting JSON will have an empty array in the_embeddednode.- Parameter:
resourceToWrap- theMonoof the main resource to wrapembeddedTypeAsNameOrigin- the class from which the list name is derived (see alsoRelation)embeddedList- theFluxof embedded resources associated with the main resource, which may be emptyexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
Monoof aHalResourceWrapperthat includes the main resource and its derived named list of embedded resources, all enhanced with hypermedia links - Siehe auch:
-