Mercurial > hg > LGServices
changeset 90:84c37b2eea36
New feature : Add source field in section page
author | Calvin Yeh <cyeh@mpipw-berlin.mpg.com> |
---|---|
date | Wed, 21 Jun 2017 06:17:41 +0200 |
parents | 85e27da9b18a |
children | fa2f274faccf |
files | src/main/java/de/mpiwg/web/search/SortSectionBySource.java |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/de/mpiwg/web/search/SortSectionBySource.java Wed Jun 21 06:17:41 2017 +0200 @@ -0,0 +1,18 @@ +package de.mpiwg.web.search; + +import java.util.Comparator; + +import de.mpiwg.gazetteer.db.DBSection; + + +public class SortSectionBySource implements Comparator<DBSection>{ + + public int compare(DBSection o1, DBSection o2) { + + if(o1.getBook() == null || o2.getBook() == null){ + return o1.getName().compareTo(o2.getName()); + } + return o1.getBook().getSource().compareTo(o2.getBook().getSource()); + } + +}