Schnittstelle EmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>

Typparameter:
ResourceT - the type of the object being wrapped, which contains the main data
EmbeddedT - 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>

public non-sealed interface EmbeddingHalWrapperAssembler<ResourceT,EmbeddedT> extends SealedNonReactiveEmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>
Interface for managing the transformation of resources and their associated embedded resources into HAL-compliant representations, supplemented with hypermedia links. This interface is designed for use in reactive programming environments where resources are emitted as a stream. It facilitates the enhancement of resource streams with the necessary fields and structure to comply with HAL standards, enabling reactive streams of resources to become HAL-compliant.

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:
  • 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 a Mono of a HalListWrapper, 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 _embedded node or the addition of an empty array in the _embedded node in the serialized JSON.

      Parameter:
      resourcesToWrap - the reactive stream of resources and their associated embedded resources to be wrapped
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalListWrapper containing 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 a Mono of a HalListWrapper with 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 _embedded node or the addition of an empty array in the _embedded node in the serialized JSON.

      Parameter:
      resourcesToWrap - the reactive stream of resources and their associated embedded resources to be wrapped
      totalElements - a Mono providing the total number of elements across all pages
      pageSize - the number of items per page
      offset - the starting offset of the page, if specified
      sortCriteria - sort criteria (property and direction) of the page
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalListWrapper containing 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 a Mono of a HalListWrapper with pagination details. This includes hypermedia links as defined by the assembler, along with pagination parameters.

      The embedded resources in the PairFlux are allowed to be null resulting in the removal of the _embedded node in the serialized JSON.

      Parameter:
      resourcesToWrap - the reactive stream of resources and their associated embedded resources to be wrapped
      totalElements - a reactor.core.publisher.Mono<Long> providing the total number of elements across all pages
      pageSize - the number of items per page
      offset - the starting offset of the page, if specified
      sortCriteria - sort criteria (property and direction) of the page
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalListWrapper containing 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 a Mono of a HalListWrapper, enhancing them with hypermedia links as defined by the assembler.

      The embedded resources in the PairFlux are allowed to be null resulting in the removal of the _embedded node in the serialized JSON.

      Parameter:
      resourcesToWrap - the reactive stream of resources and their associated embedded resources to be wrapped
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalListWrapper containing 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 reactive Mono of a resource and its associated embedded resource into a HalResourceWrapper, enhancing both with hypermedia links as defined by the assembler.

      If resourceToWrap is empty, the result will also be an empty Mono. If the embedded is empty, when serialized, the resulting JSON will not have an _embedded node.

      Parameter:
      resourceToWrap - the Mono of the resource to be wrapped
      embedded - the Mono of the associated embedded resource
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalResourceWrapper containing 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 reactive Mono of a resource and a non-empty Flux of its embedded resources into a HalResourceWrapper, appending hypermedia links as defined by the assembler.

      If resourceToWrap is empty, the result will also be an empty Mono. If the embedded is empty, when serialized, the resulting JSON will have an empty array in the _embedded node.

      Parameter:
      resourceWrap - the Mono of the main resource to wrap
      embeddedList - the Flux of 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 also Relation)
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalResourceWrapper that 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 reactive Mono of an resource and a Flux of its associated embedded resources into a HalResourceWrapper, appending hypermedia links as defined by the assembler. The list is identified by a directly provided list name. The flux may be empty.

      If resourceToWrap is empty, the result will also be an empty Mono. If the embedded is empty, when serialized, the resulting JSON will have an empty array in the _embedded node.

      Parameter:
      resourceToWrap - the Mono of the main resource to wrap
      embeddedListName - the explicitly provided name for the list of embedded resources
      embeddedList - the Flux of embedded resources associated with the main resource, which may be empty
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalResourceWrapper that 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 reactive Mono of an resource and a Flux of its associated embedded resources into a HalResourceWrapper, appending hypermedia links as defined by the assembler. The list name is derived from the specified class embeddedTypeAsNameOrigin. The list may be empty.

      If resourceToWrap is empty, the result will also be an empty Mono. If the embedded is empty, when serialized, the resulting JSON will have an empty array in the _embedded node.

      Parameter:
      resourceToWrap - the Mono of the main resource to wrap
      embeddedTypeAsNameOrigin - the class from which the list name is derived (see also Relation)
      embeddedList - the Flux of embedded resources associated with the main resource, which may be empty
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Mono of a HalResourceWrapper that includes the main resource and its derived named list of embedded resources, all enhanced with hypermedia links
      Siehe auch: