Class JsonPage<T>

  • Type Parameters:
    T - type of the contained hits.
    All Implemented Interfaces:
    Serializable, Iterable<T>, Supplier<Stream<T>>, org.springframework.data.domain.Page<T>, org.springframework.data.domain.Slice<T>, org.springframework.data.util.Streamable<T>

    public class JsonPage<T>
    extends org.springframework.data.domain.PageImpl<T>
    Workaround to allow JSON mapping for Page.
    See Also:
    Serialized Form
    • Constructor Detail

      • JsonPage

        public JsonPage​(List<T> content,
                        org.springframework.data.domain.Pageable pageable,
                        long total)
        The constructor.
        Parameters:
        content - - see PageImpl.getContent().
        pageable - - see PageImpl.getPageable().
        total - - see PageImpl.getTotalElements().
    • Method Detail

      • isFirst

        public boolean isFirst()
        Specified by:
        isFirst in interface org.springframework.data.domain.Slice<T>
      • isLast

        public boolean isLast()
        Specified by:
        isLast in interface org.springframework.data.domain.Slice<T>
        Overrides:
        isLast in class org.springframework.data.domain.PageImpl<T>
      • getNumberOfElements

        public int getNumberOfElements()
        Specified by:
        getNumberOfElements in interface org.springframework.data.domain.Slice<T>
      • getTotalPages

        public int getTotalPages()
        Specified by:
        getTotalPages in interface org.springframework.data.domain.Page<T>
        Overrides:
        getTotalPages in class org.springframework.data.domain.PageImpl<T>
      • getSort

        public org.springframework.data.domain.Sort getSort()
        Specified by:
        getSort in interface org.springframework.data.domain.Slice<T>
      • isEmpty

        public boolean isEmpty()
      • getNumber

        public int getNumber()
        Specified by:
        getNumber in interface org.springframework.data.domain.Slice<T>
      • getSize

        public int getSize()
        Specified by:
        getSize in interface org.springframework.data.domain.Slice<T>
      • hasPrevious

        public boolean hasPrevious()
        Specified by:
        hasPrevious in interface org.springframework.data.domain.Slice<T extends Object>
      • nextPageable

        public org.springframework.data.domain.Pageable nextPageable()
        Specified by:
        nextPageable in interface org.springframework.data.domain.Slice<T extends Object>
      • previousPageable

        public org.springframework.data.domain.Pageable previousPageable()
        Specified by:
        previousPageable in interface org.springframework.data.domain.Slice<T extends Object>
      • hasContent

        public boolean hasContent()
        Specified by:
        hasContent in interface org.springframework.data.domain.Slice<T extends Object>
      • getContent

        public List<T> getContent()
        Specified by:
        getContent in interface org.springframework.data.domain.Slice<T extends Object>
      • getConvertedContent

        protected <U extends ObjectList<U> getConvertedContent​(Function<? super T,​? extends U> arg0)
      • getPageable

        public org.springframework.data.domain.Pageable getPageable()
        Specified by:
        getPageable in interface org.springframework.data.domain.Slice<T extends Object>