Schnittstelle SealedNonReactiveEmbeddingHalWrapperAssembler<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>,SealedResourceLinkAssemblerModule<ResourceT>,SealedResourceListAssemblerModule<ResourceT,EmbeddedT>
- Alle bekannten Unterschnittstellen:
EmbeddingHalWrapperAssembler<ResourceT,EmbeddedT>
Core functionalities include:
- Directly enhancing main resources and their embedded resources to meet HAL structure requirements.
- Appending hypermedia links to resources to support navigability and resource interaction in a HAL-based API.
- Enabling custom naming and linking definitions for collections of embedded resources through implementation.
- Supporting pagination when wrapping lists of resources to provide structured navigation across large datasets.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungSpecifies the class type ofEmbeddedTthat the assembler builds.default HalListWrapper<ResourceT, EmbeddedT> wrapInListWrapper(MultiRightPairList<ResourceT, EmbeddedT> resourcesToWrap, long totalElements, int pageSize, Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding list of embedded resources in aHalListWrapperwith pagination information, appending hypermedia links as defined by the assembler.default HalListWrapper<ResourceT, EmbeddedT> wrapInListWrapper(MultiRightPairList<ResourceT, EmbeddedT> resourcesToWrap, HalPageInfo pageInfo, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding list of embedded resources in aHalListWrapper, optionally including pagination information, appending hypermedia links as defined by the assembler.default HalListWrapper<ResourceT, EmbeddedT> wrapInListWrapper(MultiRightPairList<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding list of embedded resources in aHalListWrapper, appending hypermedia links as defined by the assembler.default HalListWrapper<ResourceT, EmbeddedT> wrapInListWrapper(PairList<ResourceT, EmbeddedT> resourcesToWrap, long totalElements, int pageSize, Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding embedded resources in aHalListWrapperwith pagination information, appending hypermedia links as defined by the assembler.default HalListWrapper<ResourceT, EmbeddedT> wrapInListWrapper(PairList<ResourceT, EmbeddedT> resourcesToWrap, HalPageInfo pageInfo, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding embedded resources in aHalListWrapper, optionally including pagination information, appending hypermedia links as defined by the assembler.default HalListWrapper<ResourceT, EmbeddedT> wrapInListWrapper(PairList<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding embedded resources in aHalListWrapper, appending hypermedia links as defined by the assembler.default HalResourceWrapper<ResourceT, EmbeddedT> wrapInResourceWrapper(ResourceT resourceToWrap, EmbeddedT embedded, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and its corresponding embedded resource in aHalResourceWrapper, appending hypermedia links as defined by the assembler.default HalResourceWrapper<ResourceT, EmbeddedT> wrapInResourceWrapper(ResourceT resourceToWrap, Class<EmbeddedT> embeddedTypeAsNameOrigin, List<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and its list of embedded resources, with the list name derived from the specified classembeddedTypeAsNameOrigin, in aHalResourceWrapper, appending hypermedia links as defined by the assembler.default HalResourceWrapper<ResourceT, EmbeddedT> wrapInResourceWrapper(ResourceT resourceToWrap, String embeddedListName, List<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and its list of embedded resources, identified by a directly provided list name, in aHalResourceWrapper, appending hypermedia links as defined by the assembler.default HalResourceWrapper<ResourceT, EmbeddedT> wrapInResourceWrapper(ResourceT resourceToWrap, List<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and a non-empty list of its embedded resources in aHalResourceWrapper, appending 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.SealedResourceLinkAssemblerModule
buildLinksForResource, buildOtherLinksForResource, buildSelfLinkForResourceVon Schnittstelle geerbte Methoden de.kamillionlabs.hateoflux.assembler.SealedResourceListAssemblerModule
buildLinksForResourceList, buildLinksForResourceList, buildOtherLinksForResourceList, buildSelfLinkForResourceList, createEmptyListWrapper, createEmptyListWrapper, createEmptyListWrapper, createEmptyListWrapper, getResourceTClass
-
Methodendetails
-
getEmbeddedTClass
Specifies the class type ofEmbeddedTthat the assembler builds. This method is required because type erasure removes generic type information at runtime. By implementing this method, the class type ofEmbeddedTbecomes accessible. An implementation is as simple as:public Class<Author> getEmbeddedTClass() { return Author.class; }- Gibt zurück:
- the class type of
EmbeddedT
-
wrapInListWrapper
default HalListWrapper<ResourceT,EmbeddedT> wrapInListWrapper(@NonNull PairList<ResourceT, EmbeddedT> resourcesToWrap, @Nullable HalPageInfo pageInfo, @Nullable List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding embedded resources in aHalListWrapper, optionally including pagination information, appending hypermedia links as defined by the assembler.The embedded resources in the
PairListare allowed to be null resulting in the removal of the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the list of main resources and their corresponding embedded resources to wrappageInfo- optional pagination information to include in the wrappersortCriteria- 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
HalListWrapperenriched with hypermedia links and optional pagination details - Siehe auch:
-
wrapInListWrapper
default HalListWrapper<ResourceT,EmbeddedT> wrapInListWrapper(@NonNull PairList<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding embedded resources in aHalListWrapper, appending hypermedia links as defined by the assembler.The embedded resources in the
PairListare allowed to be null resulting in the removal of the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the list of main resources and their corresponding embedded resources to wrapexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
HalListWrapperequipped with hypermedia links for each resource and the list as a whole - Siehe auch:
-
wrapInListWrapper
default HalListWrapper<ResourceT,EmbeddedT> wrapInListWrapper(@NonNull PairList<ResourceT, EmbeddedT> resourcesToWrap, long totalElements, int pageSize, @Nullable Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding embedded resources in aHalListWrapperwith pagination information, appending hypermedia links as defined by the assembler.The embedded resources in the
PairListare allowed to be null resulting in the removal of the_embeddednode in the serialized JSON.- Parameter:
resourcesToWrap- the list of main resources and their corresponding embedded resources to wraptotalElements- the total number of elements across all pagespageSize- the requested/max number of elements in a single 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
HalListWrapperwith hypermedia links and pagination information - Siehe auch:
-
wrapInListWrapper
default HalListWrapper<ResourceT,EmbeddedT> wrapInListWrapper(@NonNull MultiRightPairList<ResourceT, EmbeddedT> resourcesToWrap, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding list of embedded resources in aHalListWrapper, appending 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
MultiRightPairList, 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 list of main resources and their corresponding list of embedded resources to wrapexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
HalListWrapperequipped with hypermedia links for each resource and the list as a whole - Siehe auch:
-
wrapInListWrapper
default HalListWrapper<ResourceT,EmbeddedT> wrapInListWrapper(@NonNull MultiRightPairList<ResourceT, EmbeddedT> resourcesToWrap, long totalElements, int pageSize, @Nullable Long offset, List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding list of embedded resources in aHalListWrapperwith pagination information, appending 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
MultiRightPairList, 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 list of main resources and their corresponding list of embedded resources to wraptotalElements- the total number of elements across all pagespageSize- the requested/max number of elements in a single 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
HalListWrapperwith hypermedia links and pagination information - Siehe auch:
-
wrapInListWrapper
default HalListWrapper<ResourceT,EmbeddedT> wrapInListWrapper(@NonNull MultiRightPairList<ResourceT, EmbeddedT> resourcesToWrap, @Nullable HalPageInfo pageInfo, @Nullable List<SortCriteria> sortCriteria, org.springframework.web.server.ServerWebExchange exchange) Wraps a list of main resources with their corresponding list of embedded resources in aHalListWrapper, optionally including pagination information, appending 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
MultiRightPairList, 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 list of main resources and their corresponding list of embedded resources to wrappageInfo- optional pagination information to include in the wrappersortCriteria- 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
HalListWrapperenriched with hypermedia links and optional pagination details - Siehe auch:
-
wrapInResourceWrapper
default HalResourceWrapper<ResourceT,EmbeddedT> wrapInResourceWrapper(@NonNull ResourceT resourceToWrap, EmbeddedT embedded, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and its corresponding embedded resource in aHalResourceWrapper, appending hypermedia links as defined by the assembler.The embedded resources is allowed to be null resulting in the removal of the
_embeddednode in the serialized JSON.- Parameter:
resourceToWrap- the main resource to wrapembedded- the embedded resource associated with the main resourceexchange- provides the context of the current web exchange, such as the base URL- Gibt zurück:
- a
HalResourceWrapperwith hypermedia links for the resource and its embedded counterpart - Siehe auch:
-
wrapInResourceWrapper
default HalResourceWrapper<ResourceT,EmbeddedT> wrapInResourceWrapper(@NonNull ResourceT resourceToWrap, List<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and a non-empty list of its embedded resources in aHalResourceWrapper, appending hypermedia links as defined by the assembler.The
embeddedListis 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:
resourceToWrap- the main resource to wrapembeddedList- the non-empty list of embedded resources associated with the main resource; 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
HalResourceWrapperthat 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 HalResourceWrapper<ResourceT,EmbeddedT> wrapInResourceWrapper(@NonNull ResourceT resourceToWrap, @NonNull String embeddedListName, List<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and its list of embedded resources, identified by a directly provided list name, in aHalResourceWrapper, appending hypermedia links as defined by the assembler. The list is allowed to be empty.The
embeddedListis 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:
resourceToWrap- the main resource to wrapembeddedListName- the explicitly provided name for the list of embedded resourcesembeddedList- the list of 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
HalResourceWrapperthat includes the main resource and its embedded resources, all enhanced with hypermedia links - Siehe auch:
-
wrapInResourceWrapper
default HalResourceWrapper<ResourceT,EmbeddedT> wrapInResourceWrapper(@NonNull ResourceT resourceToWrap, @NonNull Class<EmbeddedT> embeddedTypeAsNameOrigin, List<EmbeddedT> embeddedList, org.springframework.web.server.ServerWebExchange exchange) Wraps a single main resource and its list of embedded resources, with the list name derived from the specified classembeddedTypeAsNameOrigin, in aHalResourceWrapper, appending hypermedia links as defined by the assembler.The
embeddedListis 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:
resourceToWrap- the main resource to wrapembeddedTypeAsNameOrigin- the class from which the list name is derived (see alsoRelation)embeddedList- the list of 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
HalResourceWrapperthat includes the main resource and its derived named embedded resources, all enhanced with hypermedia links - Siehe auch:
-