Schnittstelle FlatHalWrapperAssembler<ResourceT>

Typparameter:
ResourceT - the type of the object being wrapped, which contains the main data
Alle Superschnittstellen:
SealedNonReactiveFlatHalWrapperAssembler<ResourceT>, SealedResourceLinkAssemblerModule<ResourceT>, SealedResourceListAssemblerModule<ResourceT,Void>

public non-sealed interface FlatHalWrapperAssembler<ResourceT> extends SealedNonReactiveFlatHalWrapperAssembler<ResourceT>
Interface for managing the transformation of standalone resources into HAL-compliant representations, supplemented with hypermedia links in a reactive programming context. This interface is tailored for reactive environments, facilitating 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 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.
  • Supporting pagination and backpressure in reactive streams when wrapping resources to provide structured navigation across large datasets reactively.
Siehe auch:
  • Methodendetails

    • wrapInListWrapper

      default reactor.core.publisher.Mono<HalListWrapper<ResourceT,Void>> wrapInListWrapper(@NonNull reactor.core.publisher.Flux<ResourceT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange)
      Wraps the provided resources in a single HalListWrapper.
      Parameter:
      resourcesToWrap - resources to wrap
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      wrapped resources
      Siehe auch:
    • wrapInListWrapper

      default reactor.core.publisher.Mono<HalListWrapper<ResourceT,Void>> wrapInListWrapper(@NonNull reactor.core.publisher.Flux<ResourceT> resourcesToWrap, @NonNull reactor.core.publisher.Mono<Long> totalElements, int pageSize, @Nullable Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange)
      Wraps the provided resources in a single HalListWrapper with paging information.
      Parameter:
      resourcesToWrap - resources to wrap
      totalElements - 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:
      wrapped resources
      Siehe auch:
    • wrapInResourceWrapper

      default reactor.core.publisher.Mono<HalResourceWrapper<ResourceT,Void>> wrapInResourceWrapper(@NonNull reactor.core.publisher.Mono<ResourceT> resourceToWrap, org.springframework.web.server.ServerWebExchange exchange)
      Wraps the provided resource in a HalResourceWrapper
      Parameter:
      resourceToWrap - resource to wrap
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      wrapped resource