Package io.keikai.app

Interface BookRepository

  • All Superinterfaces:
    java.io.Serializable

    public interface BookRepository
    extends java.io.Serializable
    Author:
    dennis
    • Method Detail

      • list

        java.util.List<BookInfo> list()
        Get the BookInfo list
        Returns:
        the BookInfo list
      • load

        Book load​(BookInfo info)
           throws java.io.IOException
        Loads a book
        Parameters:
        info - the BookInfo
        Returns:
        book or null if no such book.
        Throws:
        java.io.IOException
      • save

        BookInfo save​(BookInfo info,
                      Book book)
               throws java.io.IOException
        Saves a book and replace book of BookInfo. This method will do nothing when book's dirty flag is false.
        Parameters:
        info - the BookInfo
        book - the book to be saved
        Returns:
        the updated BookInfo, or null if not saved.
        Throws:
        java.io.IOException
      • save

        BookInfo save​(BookInfo info,
                      Book book,
                      boolean isForce)
               throws java.io.IOException
        Saves a book and replace book of BookInfo
        Parameters:
        info - the BookInfo
        book - the book to be saved
        isForce - save without dirty check if true
        Returns:
        the updated BookInfo, or null if not saved.
        Throws:
        java.io.IOException
      • saveAs

        BookInfo saveAs​(java.lang.String name,
                        Book book)
                 throws java.io.IOException
        Saves a book with a new name,
        Parameters:
        name - the new name
        book - the book to be saved
        Returns:
        the new BookInfo, or null if not saved.
        Throws:
        java.io.IOException
      • delete

        boolean delete​(BookInfo info)
                throws java.io.IOException
        Deletes a book
        Parameters:
        info - the BookInfo
        Returns:
        true if deleted, or false if not
        Throws:
        java.io.IOException