Class SlicedModel<T>

  • All Implemented Interfaces:
    Iterable<T>

    public class SlicedModel<T>
    extends org.springframework.hateoas.CollectionModel<T>
    DTO to implement binding response representations of sliceable collections.
    Since:
    1.0
    Author:
    Davide Pedone
    • Method Detail

      • empty

        public static <T> SlicedModel<T> empty()
        Creates a new empty collection model.
        Type Parameters:
        T - Entity
        Returns:
        empty SlicedModel
        Since:
        1.0
      • empty

        public static <T> SlicedModel<T> empty​(Iterable<org.springframework.hateoas.Link> links)
        Creates a new empty collection model with the given links.
        Type Parameters:
        T - Entity
        Parameters:
        links - must not be null.
        Returns:
        empty SlicedModel
        Since:
        1.0
      • getNextLink

        public org.springframework.hateoas.Link getNextLink()
        Returns the Link pointing to the next page (if set).
        Returns:
        the Link pointing to the next page
      • getSelfLink

        public org.springframework.hateoas.Link getSelfLink()
        Returns the Link pointing to the current page (if set).
        Returns:
        the Link pointing to the current page
      • iterator

        public Iterator<T> iterator()
        Specified by:
        iterator in interface Iterable<T>
        Overrides:
        iterator in class org.springframework.hateoas.CollectionModel<T>