Schnittstelle SealedResourceListAssemblerModule<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 bekannten Unterschnittstellen:
EmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>, FlatHalWrapperAssembler<ResourceT>, SealedNonReactiveEmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>, SealedNonReactiveFlatHalWrapperAssembler<ResourceT>

public sealed interface SealedResourceListAssemblerModule<ResourceT,EmbeddedT> permits SealedNonReactiveFlatHalWrapperAssembler<ResourceT>, SealedNonReactiveEmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>
Assembler module that has utility functions and builds links for a list of resources.
  • Methodendetails

    • getResourceTClass

      Class<ResourceT> getResourceTClass()
      Specifies the class type of ResourceT that the assembler builds. This method is required because type erasure removes generic type information at runtime. By implementing this method, the class type of ResourceT becomes accessible. An implementation is as simple as:
       public Class<Book> getResourceTClass() {
           return Book.class;
       }
       
      Gibt zurück:
      the class type of ResourceT
    • createEmptyListWrapper

      default HalListWrapper<ResourceT,EmbeddedT> createEmptyListWrapper(@NonNull Class<?> listItemTypeAsNameOrigin, org.springframework.web.server.ServerWebExchange exchange)
      Creates an empty HalListWrapper including hypermedia links applicable to the entire list.
      Parameter:
      listItemTypeAsNameOrigin - the class of the resource from which the list name is derived, typically pluralized to represent both resource and embedded resource types (also see Relation)
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      an initialized HalListWrapper with relevant hypermedia links for the entire list
      Siehe auch:
    • createEmptyListWrapper

      default HalListWrapper<ResourceT,EmbeddedT> createEmptyListWrapper(@NonNull Class<?> listItemTypeAsNameOrigin, int pageSize, int pageNumber, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange)
      Creates a paged empty HalListWrapper including hypermedia links applicable to the entire list.
      Parameter:
      listItemTypeAsNameOrigin - the class of the resource from which the list name is derived, typically pluralized to represent both resource and embedded resource types (also see Relation)
      pageSize - the requested/max number of elements in a single page
      pageNumber - the current page number
      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:
      an initialized HalListWrapper with relevant hypermedia links for the entire list
      Siehe auch:
    • createEmptyListWrapper

      default HalListWrapper<ResourceT,EmbeddedT> createEmptyListWrapper(@NonNull String listName, org.springframework.web.server.ServerWebExchange exchange)
      Creates an empty HalListWrapper including hypermedia links applicable to the entire list.
      Parameter:
      listName - the given name for the list
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      an initialized HalListWrapper with relevant hypermedia links for the entire list
      Siehe auch:
    • createEmptyListWrapper

      default HalListWrapper<ResourceT,EmbeddedT> createEmptyListWrapper(@NonNull String listName, int pageSize, int pageNumber, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange)
      Creates an empty HalListWrapper including hypermedia links applicable to the entire list.
      Parameter:
      listName - the given name for the list
      pageSize - the requested/max number of elements in a single page
      pageNumber - the current page number
      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:
      an initialized HalListWrapper with relevant hypermedia links for the entire list
      Siehe auch:
    • buildLinksForResourceList

      default List<Link> buildLinksForResourceList(org.springframework.web.server.ServerWebExchange exchange)
      Main method for building all links for a list of resources and embedded resources, including a self-link and other contextual links applicable to the entire list. It aggregates results from buildSelfLinkForResourceList(org.springframework.web.server.ServerWebExchange) and buildOtherLinksForResourceList(org.springframework.web.server.ServerWebExchange).
      Parameter:
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a list of Link objects representing hypermedia links for the entire list of resource and embedded resource types
    • buildLinksForResourceList

      default List<Link> buildLinksForResourceList(HalPageInfo pageInfo, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange)
      Main method for building all links for a paged list of resources and embedded resources, including navigational links and other contextual links applicable to the entire list. It aggregates results from buildSelfLinkForResourceList(org.springframework.web.server.ServerWebExchange) and buildOtherLinksForResourceList(org.springframework.web.server.ServerWebExchange).
      Parameter:
      pageInfo - pagination information about the request page
      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 list of Link objects representing hypermedia links for the entire list of resource and embedded resource types
    • buildOtherLinksForResourceList

      default List<Link> buildOtherLinksForResourceList(org.springframework.web.server.ServerWebExchange exchange)
      Provides additional contextual links for a list of resources and embedded resources, beyond the self-link, applicable to the entire list.
      Parameter:
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a list of Link objects for the entire list of resource and embedded resource types
    • buildSelfLinkForResourceList

      Link buildSelfLinkForResourceList(org.springframework.web.server.ServerWebExchange exchange)
      Creates a self-link for a list of resources and embedded resources, representing a URI that clients can use to access the list directly, applicable to the entire list.
      Parameter:
      exchange - provides the context of the current web exchange, such as the base URL
      Gibt zurück:
      a Link object representing the self-link for the entire list of resource and embedded resource types