Created
April 17, 2021 16:47
-
-
Save zivce/7c5f70cc9279d02a0ab89a3b0d74b453 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private OptionalInt readExpirationAsInt(Milk milk) | |
{ | |
String expiration = milk.getExpiration(); | |
try { | |
return Optional.of(Integer.parseInt(expiration)); | |
} | |
catch(NumberFormatException e) { | |
return OptionalInt.empty(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment