Skip to content

Commit 981d94d

Browse files
committed
don't use the same generic type
1 parent dc66efb commit 981d94d

File tree

1 file changed

+5
-2
lines changed
  • library/src/main/java/com/anotherdev/android/robospice

1 file changed

+5
-2
lines changed

library/src/main/java/com/anotherdev/android/robospice/Optional.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ public static <T> Optional<T> from(@Nullable T nullableReference) {
2323

2424
public abstract T or(T defaultValue);
2525

26+
public abstract Optional<T> or(Optional<? extends T> secondChoice);
27+
2628
@Nullable
2729
public abstract T orNull();
2830

29-
protected T checkNotNull(T reference) {
31+
32+
protected static <R> R checkNotNull(R reference) {
3033
return checkNotNull(reference, null);
3134
}
3235

33-
protected T checkNotNull(T reference, @Nullable CharSequence errorMessage) {
36+
protected static <R> R checkNotNull(R reference, @Nullable CharSequence errorMessage) {
3437
if (reference == null) {
3538
if (errorMessage == null) {
3639
throw new NullPointerException();

0 commit comments

Comments
 (0)