├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .github
├── workflows
│ ├── gradle-wrapper-validation.yml
│ └── gradle.yml
└── dependabot.yml
├── .travis.yml
├── .gitignore
├── .gitattributes
├── config
├── checkstyle
│ ├── suppressions.xml
│ └── checkstyle.xml
└── license
│ ├── HEADER
│ └── HEADER_JAVA
├── src
├── main
│ └── java
│ │ └── hu
│ │ └── akarnokd
│ │ └── rxjava3
│ │ ├── util
│ │ ├── package-info.java
│ │ ├── AlwaysTrueBooleanSupplier.java
│ │ ├── AlwaysFalseBooleanSupplier.java
│ │ ├── SneakyThrows.java
│ │ ├── SelfComparator.java
│ │ ├── BiFunctionSecondIdentity.java
│ │ └── SpscOneQueue.java
│ │ ├── async
│ │ ├── AnyValue.java
│ │ ├── package-info.java
│ │ ├── DisposableFlowable.java
│ │ └── DisposableObservable.java
│ │ ├── parallel
│ │ └── package-info.java
│ │ ├── basetypes
│ │ ├── package-info.java
│ │ ├── NonoNever.java
│ │ ├── SoloToFlowable.java
│ │ ├── NonoHide.java
│ │ ├── PerhapsHide.java
│ │ ├── SoloNever.java
│ │ ├── BasicSoloQueueSubscription.java
│ │ ├── NonoComplete.java
│ │ ├── PerhapsNever.java
│ │ ├── PerhapsFromSingle.java
│ │ ├── NonoError.java
│ │ ├── SoloError.java
│ │ ├── SoloJust.java
│ │ ├── PerhapsError.java
│ │ ├── PerhapsJust.java
│ │ ├── PerhapsEmpty.java
│ │ ├── PerhapsUnsubscribeOn.java
│ │ ├── PerhapsMap.java
│ │ ├── PerhapsDoFinally.java
│ │ ├── PerhapsObserveOn.java
│ │ ├── PerhapsMapError.java
│ │ ├── NonoDefer.java
│ │ ├── NonoOnErrorComplete.java
│ │ ├── NonoAmbArray.java
│ │ ├── NonoFromAction.java
│ │ ├── BasicNonoSubscriber.java
│ │ ├── PerhapsFromAction.java
│ │ ├── SoloDefer.java
│ │ ├── BasicEmptyQueueSubscription.java
│ │ ├── PerhapsTimer.java
│ │ ├── PerhapsSubscribeOn.java
│ │ ├── PerhapsDefer.java
│ │ ├── SoloAmbIterable.java
│ │ ├── PerhapsAmbIterable.java
│ │ ├── NonoLift.java
│ │ ├── NonoRetry.java
│ │ ├── BasicNonoIntQueueSubscription.java
│ │ ├── SoloLift.java
│ │ ├── SoloErrorSupplier.java
│ │ ├── PerhapsErrorSupplier.java
│ │ └── PerhapsLift.java
│ │ ├── joins
│ │ ├── JoinObserver.java
│ │ ├── package-info.java
│ │ ├── ActivePlan0.java
│ │ ├── ActivePlan1.java
│ │ └── Pattern1.java
│ │ ├── operators
│ │ ├── BasicEmitter.java
│ │ ├── Observables.java
│ │ ├── ExpandStrategy.java
│ │ ├── package-info.java
│ │ └── FlowableCacheLast.java
│ │ ├── debug
│ │ ├── validator
│ │ │ ├── package-info.java
│ │ │ ├── NullOnNextParameterException.java
│ │ │ ├── MultipleOnSubscribeCallsException.java
│ │ │ ├── NullOnSuccessParameterException.java
│ │ │ ├── NullOnErrorParameterException.java
│ │ │ ├── OnNextAfterTerminationException.java
│ │ │ ├── OnSuccessAfterTerminationException.java
│ │ │ ├── NullOnSubscribeParameterException.java
│ │ │ ├── MultipleTerminationsException.java
│ │ │ ├── OnSubscribeNotCalledException.java
│ │ │ ├── ProtocolNonConformanceException.java
│ │ │ ├── ConnectableFlowableValidator.java
│ │ │ ├── ParallelFlowableValidator.java
│ │ │ └── ConnectableObservableValidator.java
│ │ ├── package-info.java
│ │ ├── multihook
│ │ │ └── package-info.java
│ │ ├── SavedHooks.java
│ │ ├── MaybeOnAssemblyScalarSupplier.java
│ │ ├── SingleOnAssemblyScalarSupplier.java
│ │ ├── CompletableOnAssemblyScalarSupplier.java
│ │ ├── ObservableOnAssemblyScalarSupplier.java
│ │ ├── SingleOnAssemblySupplier.java
│ │ ├── CompletableOnAssemblySupplier.java
│ │ ├── FlowableOnAssemblyScalarSupplier.java
│ │ ├── MaybeOnAssemblySupplier.java
│ │ ├── ObservableOnAssemblyConnectable.java
│ │ └── ObservableOnAssemblySupplier.java
│ │ ├── functions
│ │ ├── package-info.java
│ │ ├── SimpleCallable.java
│ │ ├── PlainConsumer.java
│ │ ├── PlainFunction.java
│ │ ├── PlainBiConsumer.java
│ │ ├── PlainBiFunction.java
│ │ ├── PlainFunction3.java
│ │ ├── PlainFunction4.java
│ │ ├── Consumer3.java
│ │ ├── PlainFunction5.java
│ │ ├── Consumer4.java
│ │ ├── PlainFunction6.java
│ │ ├── PlainFunction7.java
│ │ ├── Consumer5.java
│ │ ├── PlainFunction8.java
│ │ ├── Consumer6.java
│ │ ├── PlainFunction9.java
│ │ ├── Consumer7.java
│ │ ├── Consumer8.java
│ │ └── Consumer9.java
│ │ ├── math
│ │ ├── ObservableSource.java
│ │ ├── FlowableSource.java
│ │ ├── package-info.java
│ │ ├── FlowableSumLong.java
│ │ ├── FlowableSumFloat.java
│ │ ├── FlowableSumInt.java
│ │ └── FlowableSumDouble.java
│ │ ├── schedulers
│ │ └── package-info.java
│ │ ├── processors
│ │ └── package-info.java
│ │ ├── string
│ │ ├── package-info.java
│ │ └── StringObservable.java
│ │ ├── subjects
│ │ └── package-info.java
│ │ ├── expr
│ │ └── package-info.java
│ │ └── consumers
│ │ └── package-info.java
├── test
│ └── java
│ │ └── hu
│ │ └── akarnokd
│ │ └── rxjava3
│ │ ├── operators
│ │ ├── SinglesTest.java
│ │ ├── CompletablesTest.java
│ │ ├── ObservablesTest.java
│ │ ├── SingleTransformersTest.java
│ │ ├── FlowableTransformersTest.java
│ │ ├── ObservableTransformersTest.java
│ │ └── CompletableTransformersTest.java
│ │ ├── subjects
│ │ └── SubjectsTest.java
│ │ ├── string
│ │ └── StringObservableTest.java
│ │ ├── parallel
│ │ └── ParallelOrderedMergeTest.java
│ │ └── test
│ │ ├── TestException.java
│ │ └── BaseTest.java
└── jmh
│ └── java
│ └── hu
│ └── akarnokd
│ └── rxjava3
│ ├── ExamplePerf.java
│ └── PerfConsumer.java
├── gradle.properties
└── push.sh
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'rxjava3-extensions'
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/akarnokd/RxJavaExtensions/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/.github/workflows/gradle-wrapper-validation.yml:
--------------------------------------------------------------------------------
1 | name: "Validate Gradle Wrapper"
2 | on: [push, pull_request]
3 |
4 | jobs:
5 | validation:
6 | name: "Validation"
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v2
10 | - uses: gradle/wrapper-validation-action@v1
11 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | jdk:
4 | - openjdk8
5 |
6 | before_install:
7 | - chmod +x gradlew
8 |
9 | after_success:
10 | - bash <(curl -s https://codecov.io/bash)
11 | - bash ./push.sh
12 |
13 | # cache between builds
14 | cache:
15 | directories:
16 | - $HOME/.m2
17 | - $HOME/.gradle
18 |
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Package Files #
4 | *.jar
5 | *.war
6 | *.ear
7 | /build/
8 |
9 | .gradle
10 | .m2
11 | /.nb-gradle/
12 | /bin/
13 | .settings/
14 | .nb-gradle-properties
15 | .classpath
16 | .project
17 | .settings
18 | .metadata
19 | .checkstyle
20 | bin/
21 | !/gradle/wrapper/gradle-wrapper.jar
22 | .pmd
23 | .ruleset
24 | local.properties
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: gradle
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | time: "04:00"
8 | open-pull-requests-limit: 20
9 | ignore:
10 | - dependency-name: com.vanniktech:gradle-maven-publish-plugin
11 | versions:
12 | - 0.14.0
13 | - 0.14.1
14 | - 0.14.2
15 | - 0.15.0
16 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set default behaviour, in case users don't have core.autocrlf set.
2 | * text=auto
3 |
4 | # Explicitly declare text files we want to always be normalized and converted
5 | # to native line endings on checkout.
6 | *.java text
7 | *.groovy text
8 | *.scala text
9 | *.clj text
10 | *.txt text
11 | *.md text
12 |
13 | # Denote all files that are truly binary and should not be modified.
14 | *.png binary
15 | *.jpg binary
16 |
--------------------------------------------------------------------------------
/config/checkstyle/suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/config/license/HEADER:
--------------------------------------------------------------------------------
1 | Copyright 2016-present David Karnok
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/config/license/HEADER_JAVA:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/util/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility classes and methods supporting the other utilities in this library.
19 | */
20 | package hu.akarnokd.rxjava3.util;
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | GROUP=com.github.akarnokd
2 | VERSION_NAME=3.1.1
3 | version=3.1.1
4 |
5 | POM_ARTIFACT_ID=rxjava3-extensions
6 | POM_NAME=RxJava 3 extra sources, operators and components
7 | POM_PACKAGING=jar
8 |
9 | POM_DESCRIPTION=RxJava 3.x extra sources, operators and components and ports of many 1.x companion libraries.
10 | POM_INCEPTION_YEAR=2016
11 |
12 | POM_URL=https://github.com/akarnokd/RxJavaExtensions
13 | POM_SCM_URL=https://github.com/akarnokd/RxJavaExtensions
14 | POM_SCM_CONNECTION=scm:git:git://github.com/akarnokd/RxJavaExtensions.git
15 | POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/akarnokd/RxJavaExtensions.git
16 |
17 | POM_LICENCE_NAME=The Apache Software License, Version 2.0
18 | POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
19 | POM_LICENCE_DIST=repo
20 |
21 | POM_DEVELOPER_ID=akarnokd
22 | POM_DEVELOPER_NAME=David Karnok
23 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/async/AnyValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.async;
18 |
19 | /**
20 | * Placeholder instance when one has to return something (and used to return {@code null} in 1.x).
21 | */
22 | public enum AnyValue {
23 | /** An arbitrary object value. */
24 | INSTANCE;
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/parallel/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods for parallel aggregation and reduction for {@link io.reactivex.rxjava3.parallel.ParallelFlowable ParallelFlowable}s via
19 | * {@link hu.akarnokd.rxjava3.parallel.ParallelTransformers ParallelTransformers}.
20 | */
21 | package hu.akarnokd.rxjava3.parallel;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/basetypes/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Proof-of-concept backpressure enabled 0..1 element reactive types:
19 | * {@link hu.akarnokd.rxjava3.basetypes.Solo Solo}, {@link hu.akarnokd.rxjava3.basetypes.Perhaps Perhaps}
20 | * and {@link hu.akarnokd.rxjava3.basetypes.Nono Nono}.
21 | */
22 | package hu.akarnokd.rxjava3.basetypes;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/joins/JoinObserver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.joins;
18 |
19 | import io.reactivex.rxjava3.disposables.Disposable;
20 |
21 | /**
22 | * Base interface to manage joined observations.
23 | */
24 | interface JoinObserver extends Disposable {
25 | void subscribe(Object gate);
26 |
27 | void dequeue();
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/operators/BasicEmitter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | /**
20 | * Abstraction over a Subscriber.
21 | *
22 | * @param the value type
23 | */
24 | public interface BasicEmitter {
25 |
26 | void doNext(T t);
27 |
28 | void doError(Throwable t);
29 |
30 | void doComplete();
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/SinglesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class SinglesTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(Singles.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Protocol validation support via {@link io.reactivex.rxjava3.plugins.RxJavaPlugins RxJavaPlugins}
19 | * hook implementations enalbed via
20 | * {@link hu.akarnokd.rxjava3.debug.validator.RxJavaProtocolValidator RxJavaProtocolValidator}.
21 | */
22 | package hu.akarnokd.rxjava3.debug.validator;
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/subjects/SubjectsTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.subjects;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class SubjectsTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(Subjects.class);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/CompletablesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class CompletablesTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(Completables.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/ObservablesTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class ObservablesTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(Observables.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Functional interface definitions for {@link io.reactivex.rxjava3.functions.Consumer Consumer}s with
19 | * 3..9 arguments and {@link io.reactivex.rxjava3.functions.Function Function}s without the
20 | * {@code throws Exception} clause in their definition.
21 | */
22 | package hu.akarnokd.rxjava3.functions;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Debugging support to remember where operators have been created in the
19 | * code via {@link io.reactivex.rxjava3.plugins.RxJavaPlugins RxJavaPlugins}' assembly hooks, enabled via
20 | * {@link hu.akarnokd.rxjava3.debug.RxJavaAssemblyTracking RxJavaAssemblyTracking}.
21 | */
22 | package hu.akarnokd.rxjava3.debug;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/math/ObservableSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.math;
18 |
19 | import io.reactivex.rxjava3.core.*;
20 |
21 | abstract class ObservableWithSource extends Observable {
22 |
23 | protected final ObservableSource source;
24 |
25 | ObservableWithSource(ObservableSource source) {
26 | this.source = source;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/SingleTransformersTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class SingleTransformersTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(SingleTransformers.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/FlowableTransformersTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class FlowableTransformersTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(FlowableTransformers.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/SimpleCallable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import java.util.concurrent.Callable;
20 |
21 | /**
22 | * A {@link Callable} with suppressed exception on its {@link #call()} method.
23 | * @param the value type
24 | */
25 | public interface SimpleCallable extends Callable {
26 |
27 | @Override
28 | T call();
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/ObservableTransformersTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class ObservableTransformersTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(ObservableTransformers.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/operators/CompletableTransformersTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.TestHelper;
22 |
23 | public class CompletableTransformersTest {
24 |
25 | @Test
26 | public void utilityClass() {
27 | TestHelper.checkUtilityClass(CompletableTransformers.class);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/schedulers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Special scheduler implementations, such as
19 | * {@link hu.akarnokd.rxjava3.schedulers.BlockingScheduler BlockingScheduler},
20 | * {@link hu.akarnokd.rxjava3.schedulers.ParallelScheduler ParallelScheduler} and
21 | * {@link hu.akarnokd.rxjava3.schedulers.SharedScheduler SharedScheduler}.
22 | */
23 | package hu.akarnokd.rxjava3.schedulers;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/async/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods to jumpstart a reactive sequence via
19 | * {@link hu.akarnokd.rxjava3.async.AsyncFlowable AsyncFlowable}
20 | * and {@link hu.akarnokd.rxjava3.async.AsyncObservable AsyncObservable};
21 | * port of the RxJavaAsyncUtil library.
22 | */
23 | package hu.akarnokd.rxjava3.async;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/math/FlowableSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.math;
18 |
19 | import org.reactivestreams.Publisher;
20 |
21 | import io.reactivex.rxjava3.core.Flowable;
22 |
23 | abstract class FlowableSource extends Flowable {
24 |
25 | protected final Publisher source;
26 |
27 | FlowableSource(Publisher source) {
28 | this.source = source;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/hu/akarnokd/rxjava3/string/StringObservableTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.string;
18 |
19 | import org.junit.Test;
20 |
21 | import hu.akarnokd.rxjava3.test.BaseTest;
22 |
23 | public class StringObservableTest extends BaseTest {
24 |
25 | @Test
26 | public void characters() {
27 | assertResult(StringObservable.characters("abcdef"), 97, 98, 99, 100, 101, 102);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/multihook/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Proof of concept {@link io.reactivex.rxjava3.plugins.RxJavaPlugins RxJavaPlugins}
19 | * hook implementation for handling multiple hooks to
20 | * the {@code onSchedule} callback via
21 | * {@link hu.akarnokd.rxjava3.debug.multihook.OnScheduleMultiHandlerManager OnScheduleMultiHandlerManager}.
22 | */
23 | package hu.akarnokd.rxjava3.debug.multihook;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/processors/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Special processors such as
19 | * {@link hu.akarnokd.rxjava3.processors.DispatchWorkProcessor DispatchWorkProcessor}
20 | * and generic utilities for {@link io.reactivex.rxjava3.processors.FlowableProcessor FlowableProcessor}s
21 | * via {@link hu.akarnokd.rxjava3.processors.FlowableProcessors} methods.
22 | */
23 | package hu.akarnokd.rxjava3.processors;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/SavedHooks.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug;
18 |
19 | /**
20 | * Remembers the previous hooks overridden by the debug
21 | * function and allows restoring them via the {@link #restore()}
22 | * method call.
23 | * @since 0.17.4
24 | */
25 | public interface SavedHooks {
26 |
27 | /**
28 | * Restore the previous set of hooks.
29 | */
30 | void restore();
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/joins/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods for join patterns (more generic way than {@code combineLatest}) via
19 | * {@link hu.akarnokd.rxjava3.joins.JoinObservable JoinObservable} wrapper and the {@code and/then/when}
20 | * vocabulary;
21 | * a port of the
22 | * RxJavaJoins
23 | * library.
24 | */
25 | package hu.akarnokd.rxjava3.joins;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/math/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods for aggregating and reducing flows with numeric content via
19 | * {@link hu.akarnokd.rxjava3.math.MathFlowable MathFlowable}
20 | * and {@link hu.akarnokd.rxjava3.math.MathObservable MathObservable};
21 | * a port of the
22 | * RxJavaMath
23 | * library.
24 | */
25 | package hu.akarnokd.rxjava3.math;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/string/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods working with strings and character sequences via
19 | * {@link hu.akarnokd.rxjava3.string.StringFlowable} and
20 | * {@link hu.akarnokd.rxjava3.string.StringObservable StringObservable};
21 | * a partial port of the
22 | * RxJavaString
23 | * library.
24 | */
25 | package hu.akarnokd.rxjava3.string;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/operators/Observables.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | /**
20 | * Utility class to create Observable sources.
21 | *
22 | * @see ObservableTransformers
23 | * @since 0.18.2
24 | */
25 | public final class Observables {
26 |
27 | /**
28 | * Utility class.
29 | */
30 | private Observables() {
31 | throw new IllegalStateException("No instances!");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/PlainConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import io.reactivex.rxjava3.functions.Consumer;
20 |
21 | /**
22 | * A {@link Consumer} with suppressed exception on its {@link #accept(Object)} method.
23 | *
24 | * @param the input value type
25 | * @since 0.17.4
26 | */
27 | public interface PlainConsumer extends Consumer {
28 |
29 | @Override
30 | void accept(T t);
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/subjects/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Special subjects such as
19 | * {@link hu.akarnokd.rxjava3.subjects.UnicastWorkSubject UnicastWorkSubject},
20 | * {@link hu.akarnokd.rxjava3.subjects.DispatchWorkSubject DispatchWorkSubject}
21 | * and generic utilities for {@link io.reactivex.rxjava3.subjects.Subject Subject}s
22 | * via {@link hu.akarnokd.rxjava3.subjects.Subjects} methods.
23 | */
24 | package hu.akarnokd.rxjava3.subjects;
--------------------------------------------------------------------------------
/config/checkstyle/checkstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/util/AlwaysTrueBooleanSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.util;
18 |
19 | import io.reactivex.rxjava3.functions.BooleanSupplier;
20 |
21 | /**
22 | * A {@link BooleanSupplier} implementation that is always true.
23 | */
24 | public enum AlwaysTrueBooleanSupplier implements BooleanSupplier {
25 | INSTANCE;
26 |
27 | @Override
28 | public boolean getAsBoolean() throws Exception {
29 | return true;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/expr/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods for computational expressions and statements via
19 | * {@link hu.akarnokd.rxjava3.expr.StatementFlowable StatementFlowable}
20 | * and {@link hu.akarnokd.rxjava3.expr.StatementObservable StatementObservable};
21 | * a port of the
22 | * RxJavaComputationExpression
23 | * library.
24 | */
25 | package hu.akarnokd.rxjava3.expr;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/PlainFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import io.reactivex.rxjava3.functions.Function;
20 |
21 | /**
22 | * A {@link Function} with suppressed exception on its {@link #apply(Object)} method.
23 | *
24 | * @param the input value type
25 | * @param the output value type
26 | */
27 | public interface PlainFunction extends Function {
28 |
29 | @Override
30 | R apply(T t);
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/util/AlwaysFalseBooleanSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.util;
18 |
19 | import io.reactivex.rxjava3.functions.BooleanSupplier;
20 |
21 | /**
22 | * A {@link BooleanSupplier} implementation that is always false.
23 | */
24 | public enum AlwaysFalseBooleanSupplier implements BooleanSupplier {
25 | INSTANCE;
26 |
27 | @Override
28 | public boolean getAsBoolean() throws Exception {
29 | return false;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/util/SneakyThrows.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.util;
18 |
19 | /**
20 | * Utility class to throw arbitrary Throwables.
21 | */
22 | public final class SneakyThrows {
23 |
24 | private SneakyThrows() {
25 | throw new IllegalStateException("No instances!");
26 | }
27 |
28 | @SuppressWarnings("unchecked")
29 | public static E justThrowX(Throwable error) throws E {
30 | throw (E)error;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/NullOnNextParameterException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * Indicates the {@code onNext} was called with a {@code null} value.
21 | * @since 0.17.4
22 | */
23 | public final class NullOnNextParameterException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public NullOnNextParameterException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/MultipleOnSubscribeCallsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * Indicates there were multiple {@code onSubscribe} calls.
21 | * @since 0.17.4
22 | */
23 | public final class MultipleOnSubscribeCallsException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public MultipleOnSubscribeCallsException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/NullOnSuccessParameterException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * Indicates the {@code onSuccess} was called with a {@code null} value.
21 | * @since 0.17.4
22 | */
23 | public final class NullOnSuccessParameterException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public NullOnSuccessParameterException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/NullOnErrorParameterException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * Indicates the {@code onError} was called with a {@code null} {@code Throwable}.
21 | * @since 0.17.4
22 | */
23 | public final class NullOnErrorParameterException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public NullOnErrorParameterException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/OnNextAfterTerminationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * The {@code onNext} was invoked after an {@code onError} or {@code onComplete} call.
21 | * @since 0.17.4
22 | */
23 | public final class OnNextAfterTerminationException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public OnNextAfterTerminationException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/operators/ExpandStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.operators;
18 |
19 | /**
20 | * Represents the strategies for recursive expansion with the {@code expand()} operator.
21 | * @since 0.16.1
22 | */
23 | public enum ExpandStrategy {
24 |
25 | /**
26 | * Expands the first item recursively before expanding the second.
27 | */
28 | DEPTH_FIRST,
29 | /**
30 | * Walk the first level of items, then walk the second level items recursively.
31 | */
32 | BREADTH_FIRST
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/OnSuccessAfterTerminationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * The {@code onSuccess} was invoked after an {@code onError} or {@code onComplete} call.
21 | * @since 0.17.4
22 | */
23 | public final class OnSuccessAfterTerminationException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public OnSuccessAfterTerminationException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/PlainBiConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import io.reactivex.rxjava3.functions.BiConsumer;
20 |
21 | /**
22 | * A {@link BiConsumer} with suppressed exception on its
23 | * {@link #accept(Object, Object)} method.
24 | *
25 | * @param the first argument type
26 | * @param the second argument type
27 | * @since 0.18.0
28 | */
29 | public interface PlainBiConsumer
30 | extends BiConsumer {
31 |
32 | @Override
33 | void accept(T1 t1, T2 t2);
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/async/DisposableFlowable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.async;
18 |
19 | import io.reactivex.rxjava3.core.Flowable;
20 | import io.reactivex.rxjava3.disposables.Disposable;
21 |
22 | /**
23 | * A {@link Flowable} that also offers a means to dispose it, cancelling/disposing
24 | * some shared underlying computation or resource via {@link Disposable#dispose()}.
25 | *
26 | * @param the value type of the sequence
27 | */
28 | public abstract class DisposableFlowable extends Flowable implements Disposable {
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/basetypes/NonoNever.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.basetypes;
18 |
19 | import org.reactivestreams.Subscriber;
20 |
21 | import io.reactivex.rxjava3.internal.subscriptions.EmptySubscription;
22 |
23 | /**
24 | * Completes the subscriber immediately.
25 | */
26 | final class NonoNever extends Nono {
27 |
28 | static final NonoNever INSTANCE = new NonoNever();
29 |
30 | @Override
31 | protected void subscribeActual(Subscriber super Void> s) {
32 | s.onSubscribe(EmptySubscription.INSTANCE);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/NullOnSubscribeParameterException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * Indicates the {@code onSubscribe} was called with a {@code null} {@code Disposable} or {@code Subscription}.
21 | * @since 0.17.4
22 | */
23 | public final class NullOnSubscribeParameterException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public NullOnSubscribeParameterException() {
28 | super();
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/async/DisposableObservable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.async;
18 |
19 | import io.reactivex.rxjava3.core.Observable;
20 | import io.reactivex.rxjava3.disposables.Disposable;
21 |
22 | /**
23 | * A {@link Observable} that also offers a means to dispose it, cancelling/disposing
24 | * some shared underlying computation or resource via {@link Disposable#dispose()}.
25 | *
26 | * @param the value type of the sequence
27 | */
28 | public abstract class DisposableObservable extends Observable implements Disposable {
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/PlainBiFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import io.reactivex.rxjava3.functions.BiFunction;
20 |
21 | /**
22 | * A {@link BiFunction} with suppressed exception on its
23 | * {@link #apply(Object, Object)} method.
24 | *
25 | * @param the first argument type
26 | * @param the second argument type
27 | * @param the output value type
28 | */
29 | public interface PlainBiFunction
30 | extends BiFunction {
31 |
32 | @Override
33 | R apply(T1 t1, T2 t2);
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/consumers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /**
18 | * Utility methods to create special consumer types, such as auto-release consumers via
19 | * {@link hu.akarnokd.rxjava3.consumers.FlowableConsumers FlowableConsumers},
20 | * {@link hu.akarnokd.rxjava3.consumers.ObservableConsumers ObservableConsumers},
21 | * {@link hu.akarnokd.rxjava3.consumers.MaybeConsumers MaybeConsumers},
22 | * {@link hu.akarnokd.rxjava3.consumers.SingleConsumers SingleConsumers} and
23 | * {@link hu.akarnokd.rxjava3.consumers.CompletableConsumers CompletableConsumers}.
24 | */
25 | package hu.akarnokd.rxjava3.consumers;
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/util/SelfComparator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.util;
18 |
19 | import java.util.Comparator;
20 |
21 | /**
22 | * Comparator that compares Comparables.
23 | */
24 | @SuppressWarnings({ "rawtypes", "unchecked" })
25 | public enum SelfComparator implements Comparator {
26 | INSTANCE;
27 |
28 | public static > Comparator instance() {
29 | return (Comparator)INSTANCE;
30 | }
31 |
32 | @Override
33 | public int compare(Comparable o1, Comparable o2) {
34 | return o1.compareTo(o2);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/MultipleTerminationsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * Indicates there were multiple {@code onError} or {@code onComplete} calls.
21 | * @since 0.17.4
22 | */
23 | public final class MultipleTerminationsException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public MultipleTerminationsException() {
28 | super();
29 | }
30 |
31 | public MultipleTerminationsException(Throwable cause) {
32 | super(cause);
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/PlainFunction3.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import io.reactivex.rxjava3.functions.Function3;
20 |
21 | /**
22 | * A {@link Function3} with suppressed exception on its
23 | * {@link #apply(Object, Object, Object)} method.
24 | *
25 | * @param the first argument type
26 | * @param the second argument type
27 | * @param the third argument type
28 | * @param the output value type
29 | */
30 | public interface PlainFunction3
31 | extends Function3 {
32 |
33 | @Override
34 | R apply(T1 t1, T2 t2, T3 t3);
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/basetypes/SoloToFlowable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.basetypes;
18 |
19 | import org.reactivestreams.Subscriber;
20 |
21 | import io.reactivex.rxjava3.core.Flowable;
22 |
23 | /**
24 | * Converts a Solo into a Flowable.
25 | *
26 | * @param the value type
27 | */
28 | final class SoloToFlowable extends Flowable {
29 |
30 | final Solo source;
31 |
32 | SoloToFlowable(Solo source) {
33 | this.source = source;
34 | }
35 |
36 | @Override
37 | protected void subscribeActual(Subscriber super T> s) {
38 | source.subscribe(s);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/basetypes/NonoHide.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.basetypes;
18 |
19 | import org.reactivestreams.Subscriber;
20 |
21 | import hu.akarnokd.rxjava3.basetypes.SoloHide.HideSubscriber;
22 |
23 | /**
24 | * Hides the identity of the upstream and downstream including
25 | * breaking fusion.
26 | */
27 | final class NonoHide extends Nono {
28 |
29 | final Nono source;
30 |
31 | NonoHide(Nono source) {
32 | this.source = source;
33 | }
34 |
35 | @Override
36 | protected void subscribeActual(Subscriber super Void> s) {
37 | source.subscribe(new HideSubscriber(s));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/debug/validator/OnSubscribeNotCalledException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.debug.validator;
18 |
19 | /**
20 | * The {@code onSubscribe} was not called before calling {@code onNext},
21 | * {@code onSuccess}, {@code onError} or {@code onComplete}.
22 | */
23 | public final class OnSubscribeNotCalledException extends ProtocolNonConformanceException {
24 |
25 | private static final long serialVersionUID = -6096755460680899745L;
26 |
27 | public OnSubscribeNotCalledException() {
28 | super();
29 | }
30 |
31 | public OnSubscribeNotCalledException(Throwable cause) {
32 | super(cause);
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/joins/ActivePlan0.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.joins;
18 |
19 | import java.util.*;
20 |
21 | /**
22 | * Represents an activated plan.
23 | */
24 | abstract class ActivePlan0 {
25 | protected final Map joinObservers = new HashMap<>();
26 |
27 | protected abstract void match() throws Throwable;
28 |
29 | protected void addJoinObserver(JoinObserver joinObserver) {
30 | joinObservers.put(joinObserver, joinObserver);
31 | }
32 |
33 | protected void dequeue() {
34 | for (JoinObserver jo : joinObservers.values()) {
35 | jo.dequeue();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/basetypes/PerhapsHide.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.basetypes;
18 |
19 | import org.reactivestreams.Subscriber;
20 |
21 | import hu.akarnokd.rxjava3.basetypes.SoloHide.HideSubscriber;
22 |
23 | /**
24 | * Hides the identity of the upstream Solo and its Subscription.
25 | *
26 | * @param the value type
27 | */
28 | final class PerhapsHide extends Perhaps {
29 |
30 | final Perhaps source;
31 |
32 | PerhapsHide(Perhaps source) {
33 | this.source = source;
34 | }
35 |
36 | @Override
37 | protected void subscribeActual(Subscriber super T> s) {
38 | source.subscribe(new HideSubscriber(s));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/functions/PlainFunction4.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.functions;
18 |
19 | import io.reactivex.rxjava3.functions.Function4;
20 |
21 | /**
22 | * A {@link Function4} with suppressed exception on its
23 | * {@link #apply(Object, Object, Object, Object)} method.
24 | *
25 | * @param the first argument type
26 | * @param the second argument type
27 | * @param the third argument type
28 | * @param the fourth argument type
29 | * @param the output value type
30 | */
31 | public interface PlainFunction4
32 | extends Function4 {
33 |
34 | @Override
35 | R apply(T1 t1, T2 t2, T3 t3, T4 t4);
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/hu/akarnokd/rxjava3/basetypes/SoloNever.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-present David Karnok
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package hu.akarnokd.rxjava3.basetypes;
18 |
19 | import org.reactivestreams.Subscriber;
20 |
21 | import io.reactivex.rxjava3.internal.subscriptions.EmptySubscription;
22 |
23 | /**
24 | * Never signals an event other than onSubscribe.
25 | */
26 | final class SoloNever extends Solo