Mercurial > hg > LGServices
view src/main/java/de/mpiwg/web/books/SortBooksByBookYear.java @ 89:85e27da9b18a
New feature : add book_year and edition_year in Books page
author | Calvin Yeh <cyeh@mpipw-berlin.mpg.com> |
---|---|
date | Wed, 21 Jun 2017 05:58:54 +0200 |
parents | |
children |
line wrap: on
line source
package de.mpiwg.web.books; import java.util.Comparator; import de.mpiwg.gazetteer.db.DBBook; public class SortBooksByBookYear implements Comparator<DBBook>{ public int compare(DBBook o1, DBBook o2) { if(o1 == null || o2 == null){ return o1.getName().compareTo(o2.getName()); } return o1.getBookYear().compareTo(o2.getBookYear()); } }