Class PagedConverter


  • public final class PagedConverter
    extends Object
    Utility class for conversion of PagedResponse.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> com.azure.core.http.rest.PagedFlux<T> convertListToPagedFlux​(Mono<com.azure.core.http.rest.Response<List<T>>> responseMono)
      Converts Response of List to PagedFlux.
      static <T,​S>
      com.azure.core.http.rest.PagedFlux<S>
      flatMapPage​(com.azure.core.http.rest.PagedFlux<T> pagedFlux, Function<? super T,​? extends org.reactivestreams.Publisher<? extends S>> mapper)
      Applies flatMap transform to elements of PagedFlux.
      static <T,​S>
      com.azure.core.http.rest.PagedFlux<S>
      mapPage​(com.azure.core.http.rest.PagedFlux<T> pagedFlux, Function<T,​S> mapper)
      Applies map transform to elements of PagedFlux.
      static <T,​S>
      com.azure.core.http.rest.PagedIterable<S>
      mapPage​(com.azure.core.http.rest.PagedIterable<T> pageIterable, Function<T,​S> mapper)
      Applies map transform to elements of PagedIterable.
      static <T,​S>
      com.azure.core.http.rest.PagedFlux<S>
      mergePagedFlux​(com.azure.core.http.rest.PagedFlux<T> pagedFlux, Function<? super T,​com.azure.core.http.rest.PagedFlux<S>> transformer)
      Merge collection of all PagedFlux transformed from elements of PagedFlux to a single PagedFlux.
    • Method Detail

      • mapPage

        public static <T,​S> com.azure.core.http.rest.PagedIterable<S> mapPage​(com.azure.core.http.rest.PagedIterable<T> pageIterable,
                                                                                    Function<T,​S> mapper)
        Applies map transform to elements of PagedIterable.
        Type Parameters:
        T - input type of PagedFlux.
        S - return type of PagedFlux.
        Parameters:
        pageIterable - the input of PagedIterable.
        mapper - the map transform of element T to element S.
        Returns:
        the PagedFlux with elements in PagedResponse transformed.
      • mapPage

        public static <T,​S> com.azure.core.http.rest.PagedFlux<S> mapPage​(com.azure.core.http.rest.PagedFlux<T> pagedFlux,
                                                                                Function<T,​S> mapper)
        Applies map transform to elements of PagedFlux.
        Type Parameters:
        T - input type of PagedFlux.
        S - return type of PagedFlux.
        Parameters:
        pagedFlux - the input of PagedFlux.
        mapper - the map transform of element T to element S.
        Returns:
        the PagedFlux with elements in PagedResponse transformed.
      • flatMapPage

        public static <T,​S> com.azure.core.http.rest.PagedFlux<S> flatMapPage​(com.azure.core.http.rest.PagedFlux<T> pagedFlux,
                                                                                    Function<? super T,​? extends org.reactivestreams.Publisher<? extends S>> mapper)
        Applies flatMap transform to elements of PagedFlux.
        Type Parameters:
        T - input type of PagedFlux.
        S - return type of PagedFlux.
        Parameters:
        pagedFlux - the input of PagedFlux.
        mapper - the flatMap transform of element T to Publisher of S.
        Returns:
        the PagedFlux with elements in PagedResponse transformed.
      • mergePagedFlux

        public static <T,​S> com.azure.core.http.rest.PagedFlux<S> mergePagedFlux​(com.azure.core.http.rest.PagedFlux<T> pagedFlux,
                                                                                       Function<? super T,​com.azure.core.http.rest.PagedFlux<S>> transformer)
        Merge collection of all PagedFlux transformed from elements of PagedFlux to a single PagedFlux.
        Type Parameters:
        T - input type of PagedFlux.
        S - return type of PagedFlux.
        Parameters:
        pagedFlux - the input of PagedFlux.
        transformer - the transform of element T to PagedFlux of S.
        Returns:
        the merged PagedFlux.
      • convertListToPagedFlux

        public static <T> com.azure.core.http.rest.PagedFlux<T> convertListToPagedFlux​(Mono<com.azure.core.http.rest.Response<List<T>>> responseMono)
        Converts Response of List to PagedFlux.
        Type Parameters:
        T - type of element.
        Parameters:
        responseMono - the Response of List to convert.
        Returns:
        the PagedFlux.