Skip to content

Commit

Permalink
Rename Single.equals to Single.sequenceEqual (#6856)
Browse files Browse the repository at this point in the history
* Rename Single.equals to Single.sequenceEqual

* Rename Single.sequenceEqual arguments

* Update mentions of renamed parameters
  • Loading branch information
slisaasquatch authored and akarnokd committed Jan 21, 2020
1 parent 0c84f40 commit 13ffa18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
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

0 comments on commit 13ffa18

Please sign in to comment.