Skip to content

Commit

Permalink
Reformat photo function logic
Browse files Browse the repository at this point in the history
  • Loading branch information
huangsam committed Dec 17, 2024
1 parent 89f0129 commit 2cddbd6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class PhotoFunction {
public static Function<Photo, String> yearTaken() {
return photo -> {
LocalDateTime takenTime = photo.takenAt();
return (takenTime == null) ? null : String.valueOf(takenTime.getYear());
return (takenTime == null)
? null
: String.valueOf(takenTime.getYear());
};
}

Expand All @@ -22,7 +24,8 @@ public static Function<Photo, String> yearModified() {
return photo -> {
FileTime modifiedTime = photo.modifiedAt();
return (modifiedTime == null)
? null : String.valueOf(modifiedTime.toInstant().atZone(ZoneId.systemDefault()).getYear());
? null
: String.valueOf(modifiedTime.toInstant().atZone(ZoneId.systemDefault()).getYear());
};
}
}

0 comments on commit 2cddbd6

Please sign in to comment.