Skip to content

Commit 2e13be0

Browse files
authored
Apply suggestions from code review
1 parent 84c1a86 commit 2e13be0

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

api/src/main/java/io/minio/messages/Item.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.nio.charset.StandardCharsets;
2222
import java.time.ZonedDateTime;
2323
import java.util.Map;
24-
import java.util.Optional;
2524
import org.simpleframework.xml.Element;
2625

2726
/**
@@ -87,9 +86,7 @@ public String objectName() {
8786

8887
/** Returns last modified time of the object. */
8988
public ZonedDateTime lastModified() {
90-
return Optional.ofNullable(lastModified)
91-
.map(ResponseDate::zonedDateTime)
92-
.orElse(null);
89+
return (lastModified == null) ? null : lastModified.zonedDateTime();
9390
}
9491

9592
/** Returns ETag of the object. */
@@ -114,9 +111,7 @@ public Owner owner() {
114111

115112
/** Returns user metadata. This is MinIO specific extension to ListObjectsV2. */
116113
public Map<String, String> userMetadata() {
117-
return Optional.ofNullable(userMetadata)
118-
.map(Metadata::get)
119-
.orElse(null);
114+
return (userMetadata == null) ? null : userMetadata.get();
120115
}
121116

122117
public String userTags() {

0 commit comments

Comments
 (0)