List of usage examples for org.joda.time Instant isAfterNow
public boolean isAfterNow()
From source file:dk.nsi.stamdata.cpr.PersonMapper.java
License:Mozilla Public License
private boolean isPersonProtected(Person person) { if (person.getNavnebeskyttelsestartdato() == null) return false; // We have to make the guard above to avoid null being passed into the // Instant/* w w w .java2 s . co m*/ // it is converted to the beginning of the era. Preconditions.checkState(person.getNavnebeskyttelseslettedato() != null, "The protection end date was not present. This is most unexpected and a programming error."); Instant protectionStart = new Instant(person.getNavnebeskyttelsestartdato()); Instant protectionEnd = new Instant(person.getNavnebeskyttelseslettedato()); return protectionStart.isEqualNow() || (protectionStart.isBeforeNow() && protectionEnd.isAfterNow()); }