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

Rename Single.equals to Single.sequenceEqual #6856

Merged
merged 3 commits into from
Jan 21, 2020
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
16 changes: 8 additions & 8 deletions src/main/java/io/reactivex/rxjava3/core/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -1387,22 +1387,22 @@ public static Single<Long> timer(long delay, @NonNull TimeUnit unit, @NonNull Sc
* <img width="640" height="465" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.equals.png" alt="">
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code equals} does not operate by default on a particular {@link Scheduler}.</dd>
* <dd>{@code sequenceEqual} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* @param <T> the common value type
* @param first the first {@code SingleSource} instance
* @param second the second {@code SingleSource} instance
* @param source1 the first {@code SingleSource} instance
* @param source2 the second {@code SingleSource} instance
* @return the new {@code Single} instance
* @throws NullPointerException if {@code first} or {@code second} is {@code null}
* @throws NullPointerException if {@code source1} or {@code source2} is {@code null}
* @since 2.0
*/
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<Boolean> equals(@NonNull SingleSource<? extends T> first, @NonNull SingleSource<? extends T> second) { // NOPMD
Objects.requireNonNull(first, "first is null");
Objects.requireNonNull(second, "second is null");
return RxJavaPlugins.onAssembly(new SingleEquals<>(first, second));
public static <T> Single<Boolean> sequenceEqual(@NonNull SingleSource<? extends T> source1, @NonNull SingleSource<? extends T> source2) { // NOPMD
Objects.requireNonNull(source1, "source1 is null");
Objects.requireNonNull(source2, "source2 is null");
return RxJavaPlugins.onAssembly(new SingleEquals<>(source1, source2));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class SingleEqualsTest extends RxJavaTest {
public void bothError() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
Single.equals(Single.error(new TestException("One")), Single.error(new TestException("Two")))
Single.sequenceEqual(Single.error(new TestException("One")), Single.error(new TestException("Two")))
.to(TestHelper.<Boolean>testConsumer())
.assertFailureAndMessage(TestException.class, "One");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ public void toObservable() {

@Test
public void equals() {
Single.equals(Single.just(1), Single.just(1).hide())
Single.sequenceEqual(Single.just(1), Single.just(1).hide())
.test()
.assertResult(true);

Single.equals(Single.just(1), Single.just(2))
Single.sequenceEqual(Single.just(1), Single.just(2))
.test()
.assertResult(false);
}
Expand Down