Skip to content

Commit ca424ff

Browse files
committed
Sync with underscore-java.
1 parent d4d5588 commit ca424ff

File tree

13 files changed

+1437
-1063
lines changed

13 files changed

+1437
-1063
lines changed

src/main/java/com/github/underscore/Optional.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static <T> Optional<T> of(final T arg) {
2525
}
2626

2727
public static <T> Optional<T> fromNullable(final T nullableReference) {
28-
return nullableReference == null ? Optional.<T>empty() : new Optional<>(nullableReference);
28+
return nullableReference == null ? Optional.empty() : new Optional<>(nullableReference);
2929
}
3030

3131
@SuppressWarnings("unchecked")
@@ -64,16 +64,16 @@ public boolean isPresent() {
6464

6565
@SuppressWarnings("unchecked")
6666
public Optional<T> filter(Predicate<? super T> predicate) {
67-
U.checkNotNull(predicate);
67+
Underscore.checkNotNull(predicate);
6868
if (isPresent()) {
69-
return predicate.test(arg) ? this : Optional.<T>empty();
69+
return predicate.test(arg) ? this : Optional.empty();
7070
} else {
7171
return this;
7272
}
7373
}
7474

7575
public <F> Optional<F> map(Function<? super T, F> mapper) {
76-
U.checkNotNull(mapper);
76+
Underscore.checkNotNull(mapper);
7777
if (isPresent()) {
7878
return Optional.fromNullable(mapper.apply(arg));
7979
} else {

0 commit comments

Comments
 (0)