Class AbstractSliceDto<T>

java.lang.Object
org.bremersee.pagebuilder.model.AbstractSliceDto<T>
Type Parameters:
T - the type of the content
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AbstractPageDto, CommonSliceDto, JsonSliceDto

public abstract class AbstractSliceDto<T> extends Object
The abstract slice data transfer object.
Author:
Christian Bremer
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<T>
    The content.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Instantiates a new abstract slice data transfer object.
    protected
    AbstractSliceDto(List<? extends T> content, int number, int size, boolean hasNext)
    Instantiates a new abstract slice data transfer object.
    protected
    AbstractSliceDto(List<? extends T> content, int number, int size, boolean hasNext, SortOrder sort)
    Instantiates a new abstract slice data transfer object.
    protected
    AbstractSliceDto(List<? extends T> content, int number, int size, boolean hasNext, org.springframework.data.domain.Sort sort)
    Instantiates a new abstract slice data transfer object.
    protected
    AbstractSliceDto(org.springframework.data.domain.Slice<? extends T> slice)
    Instantiates a new abstract slice data transfer object.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract List<T>
    Gets content.
    int
    Gets the page or slice number starting with 0.
    int
    Gets the number of elements.
    org.springframework.data.domain.Pageable
    Gets pageable.
    int
    Gets the size of the page or slice (not the size of the content).
    Gets sort.
    boolean
    Indicates whether the content is present.
    boolean
    Indicates whether the page or slice is the first.
    boolean
    Indicates whether the page or slice is the last.
    boolean
    Indicates whether a next page or slice is available.
    boolean
    Indicates whether a previous page or slice is available.
    protected void
    setContent(List<T> content)
    Sets content.
    protected void
    setContentPresent(boolean contentPresent)
    Sets content present.
    protected void
    setFirst(boolean first)
    Sets first.
    protected void
    setLast(boolean last)
    Sets last.
    protected abstract void
    setNextAvailable(boolean nextAvailable)
    Sets next available.
    protected abstract void
    setNumber(int number)
    Sets number.
    protected void
    setNumberOfElements(int numberOfElements)
    Sets the number of elements.
    protected void
    setPreviousAvailable(boolean previousAvailable)
    Sets previous available.
    protected abstract void
    setSize(int size)
    Sets size.
    org.springframework.data.domain.Slice<T>
    To slice.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • content

      protected List<T> content
      The content.
  • Constructor Details

    • AbstractSliceDto

      protected AbstractSliceDto()
      Instantiates a new abstract slice data transfer object.
    • AbstractSliceDto

      protected AbstractSliceDto(List<? extends T> content, int number, int size, boolean hasNext)
      Instantiates a new abstract slice data transfer object.
      Parameters:
      content - the content
      number - the number
      size - the size
      hasNext - the has next
    • AbstractSliceDto

      protected AbstractSliceDto(List<? extends T> content, int number, int size, boolean hasNext, SortOrder sort)
      Instantiates a new abstract slice data transfer object.
      Parameters:
      content - the content of the slice
      number - the number of the slice starting with 0
      size - the size of the slice (not the size of the content)
      hasNext - the has next
      sort - the sort oder
    • AbstractSliceDto

      protected AbstractSliceDto(List<? extends T> content, int number, int size, boolean hasNext, org.springframework.data.domain.Sort sort)
      Instantiates a new abstract slice data transfer object.
      Parameters:
      content - the content
      number - the number
      size - the size
      hasNext - the has next
      sort - the sort
    • AbstractSliceDto

      protected AbstractSliceDto(org.springframework.data.domain.Slice<? extends T> slice)
      Instantiates a new abstract slice data transfer object.
      Parameters:
      slice - the slice
  • Method Details

    • getNumber

      public int getNumber()
      Gets the page or slice number starting with 0.
      Returns:
      the page or slice number starting with 0
    • getSize

      public int getSize()
      Gets the size of the page or slice (not the size of the content).
      Returns:
      the size of the page or slice (not the size of the content)
    • isNextAvailable

      public boolean isNextAvailable()
      Indicates whether a next page or slice is available.
      Returns:
      the boolean
    • getContent

      public abstract List<T> getContent()
      Gets content.
      Returns:
      the content
    • setContent

      protected void setContent(List<T> content)
      Sets content.
      Parameters:
      content - the content
    • isContentPresent

      public boolean isContentPresent()
      Indicates whether the content is present.
      Returns:
      the boolean
    • setContentPresent

      protected void setContentPresent(boolean contentPresent)
      Sets content present. This method is ignored.
      Parameters:
      contentPresent - the content present
    • getSort

      public SortOrder getSort()
      Gets sort.
      Returns:
      the sort
    • setNumber

      protected abstract void setNumber(int number)
      Sets number.
      Parameters:
      number - the number
    • setSize

      protected abstract void setSize(int size)
      Sets size.
      Parameters:
      size - the size
    • getNumberOfElements

      public int getNumberOfElements()
      Gets the number of elements.
      Returns:
      the number of elements
    • setNumberOfElements

      protected void setNumberOfElements(int numberOfElements)
      Sets the number of elements. This method is ignored.
      Parameters:
      numberOfElements - the number of elements
    • isFirst

      public boolean isFirst()
      Indicates whether the page or slice is the first.
      Returns:
      the boolean
    • setFirst

      protected void setFirst(boolean first)
      Sets first. This method is ignored.
      Parameters:
      first - the first
    • isLast

      public boolean isLast()
      Indicates whether the page or slice is the last.
      Returns:
      the boolean
    • setLast

      protected void setLast(boolean last)
      Sets last. This method is ignored.
      Parameters:
      last - the last
    • setNextAvailable

      protected abstract void setNextAvailable(boolean nextAvailable)
      Sets next available.
      Parameters:
      nextAvailable - the next available
    • isPreviousAvailable

      public boolean isPreviousAvailable()
      Indicates whether a previous page or slice is available.
      Returns:
      the boolean
    • setPreviousAvailable

      protected void setPreviousAvailable(boolean previousAvailable)
      Sets previous available. This method is ignored.
      Parameters:
      previousAvailable - the previous available
    • getPageable

      public org.springframework.data.domain.Pageable getPageable()
      Gets pageable.
      Returns:
      the pageable
    • toSlice

      public org.springframework.data.domain.Slice<T> toSlice()
      To slice.
      Returns:
      the slice