Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unnecessary Utilities #1806

Merged
merged 2 commits into from
Oct 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions src/main/java/rx/functions/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,60 +90,6 @@ public void call(Object... args) {
}
}

/**
* Extracts a method reference to the Observer's {@link Observer#onNext onNext} method in the form of an
* {@link Action1}.
* <p>Java 8: observer::onNext</p>
*
* @param observer
* the {@link Observer} to use
* @return an action which calls observer's {@code onNext} method.
*/
public static <T> Action1<T> onNextFrom(final Observer<T> observer) {
return new Action1<T>() {
@Override
public void call(T t1) {
observer.onNext(t1);
}
};
}

/**
* Extracts a method reference to the Observer's {@link Observer#onError(java.lang.Throwable) onError}
* method in the form of an {@link Action1}.
* <p>Java 8: observer::onError</p>
*
* @param observer
* the {@link Observer} to use
* @return an action which calls observer's {@code onError} method.
*/
public static <T> Action1<Throwable> onErrorFrom(final Observer<T> observer) {
return new Action1<Throwable>() {
@Override
public void call(Throwable t1) {
observer.onError(t1);
}
};
}

/**
* Extracts a method reference to the Observer's {@link Observer#onCompleted() onCompleted} method in the
* form of an {@link Action0}.
* <p>Java 8: observer::onCompleted</p>
*
* @param observer
* the {@link Observer} to use
* @return an action which calls observer's {@code onCompleted} method.
*/
public static <T> Action0 onCompletedFrom(final Observer<T> observer) {
return new Action0() {
@Override
public void call() {
observer.onCompleted();
}
};
}

/**
* Converts an {@link Action0} to a function that calls the action and returns {@code null}.
*
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/rx/functions/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,19 +344,6 @@ public Void call(Object... args) {
};
}

/**
* Constructs a predicate that returns true for each input for which the source predicate returns false, and
* vice versa.
*
* @param predicate
* the source predicate to negate
* @return a function that returns a Boolean that represents an inversion of the logical effect of
* {@code predicate}
*/
public static <T> Func1<T, Boolean> not(Func1<? super T, Boolean> predicate) {
return new Not<T>(predicate);
}

/**
* Returns a function that always returns {@code true}.
*
Expand Down
42 changes: 0 additions & 42 deletions src/main/java/rx/functions/Not.java

This file was deleted.