package ch.difty.scipamato.public_.persistence.api;

import java.io.Serializable;
import java.util.List;
import java.util.Optional;

import ch.difty.scipamato.common.NullArgumentException;
import ch.difty.scipamato.common.persistence.paging.PaginationContext;
import ch.difty.scipamato.public_.entity.PublicPaper;
import ch.difty.scipamato.public_.entity.filter.PublicPaperFilter;

public interface PublicPaperService extends Serializable {

    /**
     * Finds an individual paper by it's number (business key). Returns it as an optional of {@link PublicPaper}
     *
     * @param number - must not be null
     * @return Optional
     * @throws NullArgumentException if id is null
     */
    Optional<PublicPaper> findByNumber(Long number);

    /**
     * Finds a page full of {@link PublicPaper}s matching the provided filter and pagination context.
     *
     * @param filter the filter
     * @param paginationContext context defining paging and sorting
     * @return a page of papers as list
     */
    List<PublicPaper> findPageByFilter(PublicPaperFilter filter, PaginationContext paginationContext);

    /**
     * Counts the number of entities matching the specified filter.
     *
     * @param filter
     * @return entity count
     */
    int countByFilter(PublicPaperFilter filter);

    /**
     * Finds the numbers (business key) of the persisted papers matching the provided filter and pagination context.
     *
     * @param filter
     * @param paginationContext {@link PaginationContext}
     * @return list of the numbers of matching papers
     */
    List<Long> findPageOfNumbersByFilter(PublicPaperFilter filter, PaginationContext paginationContext);

}

@@ -523,16 +523,23 @@
 it as an
+%0A     *
  optiona
@@ -590,16 +590,34 @@
 m number
+%0A     *           
  - must 
@@ -688,16 +688,35 @@
 xception
+%0A     *            
  if id i
@@ -865,32 +865,39 @@
 vided filter and
+%0A     *
  pagination cont
@@ -928,16 +928,34 @@
 m filter
+%0A     *           
  the fil
@@ -989,16 +989,34 @@
 nContext
+%0A     *           
  context
@@ -1462,32 +1462,39 @@
 ers matching the
+%0A     *
  provided filter
@@ -1577,16 +1577,34 @@
 nContext
+%0A     *           
  %7B@link 

Format and organize imports