Last active
November 22, 2018 01:46
-
-
Save BumpeiShimada/e0a90eb0cd4d61f6f28a55d699f39788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginLogic { | |
@Autowired | |
private OriginalTimeManager timeManager; // This is an in-house class for managing data related to dates | |
/** | |
* @param graduateYear | |
* @return whether current date is after or equal to graduate year's 1st April | |
* @throws NullPointerException if the param graduateYear is null | |
*/ | |
boolean isAfterServiceGraduateDate(@NonNull Integer graduateYear) { | |
LocalDate serviceGraduateDate = LocalDate.of(graduateYear, 4, 1); // In Japan, students commonly graduates at the end of March | |
LocalDate currentLocalDate = timeManager.getCurrentLocalDate(); | |
return currentLocalDate.isAfter(serviceGraduateDate) || currentLocalDate.isEqual(serviceGraduateDate); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment