Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Convert to restro stream APIs #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ dependencies {
implementation("org.jctools:jctools-core:${property("jctools.version")}")
implementation("org.jetbrains:annotations:${property("annotations.version")}")
implementation("com.google.dagger:dagger:${property("dagger.version")}")
implementation ("net.sourceforge.streamsupport:android-retrostreams:1.7.4")
implementation ("net.sourceforge.streamsupport:android-retrofuture:1.7.4")

compileOnly("org.slf4j:slf4j-api:${property("slf4j.version")}")

Expand Down
2 changes: 2 additions & 0 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ metadata {

dependencies {
implementation(rootProject)
implementation ("net.sourceforge.streamsupport:android-retrostreams:1.7.4")
implementation ("net.sourceforge.streamsupport:android-retrofuture:1.7.4")
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.hivemq.client.mqtt.mqtt5.lifecycle.Mqtt5ClientDisconnectedContext;

import java.time.LocalTime;
import java.util.concurrent.CompletableFuture;
import java9.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import reactor.core.Fuseable;
import reactor.util.context.Context;

import java.util.function.Function;
import java9.util.function.Function;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import java.util.NoSuchElementException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import java.util.function.Function;
import java9.util.function.Consumer;
import java9.util.function.Function;

/**
* A {@link Flux} which emits a flow of items of type <code>F</code> and a single item of type <code>S</code>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Stream;
import java9.util.stream.Stream;

import static org.junit.jupiter.api.Assertions.*;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
import org.jetbrains.annotations.Nullable;
import org.reactivestreams.Subscription;

import java.util.concurrent.CompletableFuture;
import java9.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java9.util.function.Consumer;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import org.reactivestreams.Subscription;

import java.util.LinkedList;
import java.util.Optional;
import java9.util.Optional;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;
import java9.util.Optional;
import java.util.concurrent.atomic.AtomicReference;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Optional;
import java9.util.Optional;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.jetbrains.annotations.Nullable;

import java.util.Objects;
import java.util.Optional;
import java.util.OptionalInt;
import java9.util.Optional;
import java9.util.OptionalInt;
import java.util.concurrent.Executor;

/**
Expand Down Expand Up @@ -93,7 +93,7 @@ public boolean equals(final @Nullable Object o) {

@Override
public int hashCode() {
int result = Objects.hashCode(nettyExecutor);
int result = java9.util.Objects.hashCode(nettyExecutor);
result = 31 * result + nettyThreads;
result = 31 * result + applicationScheduler.hashCode();
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.Executor;
import java.util.function.Function;
import java9.util.function.Function;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
import javax.net.ssl.*;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

import java9.lang.Integers;
import java9.util.Optional;

/**
* @author David Katz
Expand Down Expand Up @@ -145,12 +147,12 @@ public boolean equals(final @Nullable Object o) {

@Override
public int hashCode() {
int result = Objects.hashCode(keyManagerFactory);
result = 31 * result + Objects.hashCode(trustManagerFactory);
result = 31 * result + Objects.hashCode(cipherSuites);
result = 31 * result + Objects.hashCode(protocols);
result = 31 * result + Integer.hashCode(handshakeTimeoutMs);
result = 31 * result + Objects.hashCode(hostnameVerifier);
int result = java9.util.Objects.hashCode(keyManagerFactory);
result = 31 * result + java9.util.Objects.hashCode(trustManagerFactory);
result = 31 * result + java9.util.Objects.hashCode(cipherSuites);
result = 31 * result + java9.util.Objects.hashCode(protocols);
result = 31 * result + Integers.hashCode(handshakeTimeoutMs);
result = 31 * result + java9.util.Objects.hashCode(hostnameVerifier);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import javax.net.ssl.TrustManagerFactory;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java9.util.function.Function;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

import java.net.InetSocketAddress;
import java.util.Objects;
import java.util.Optional;

import java9.lang.Integers;
import java9.util.Optional;

/**
* @author Silvio Giebl
Expand Down Expand Up @@ -140,12 +142,12 @@ public boolean equals(final @Nullable Object o) {
@Override
public int hashCode() {
int result = serverAddress.hashCode();
result = 31 * result + Objects.hashCode(localAddress);
result = 31 * result + Objects.hashCode(sslConfig);
result = 31 * result + Objects.hashCode(webSocketConfig);
result = 31 * result + Objects.hashCode(proxyConfig);
result = 31 * result + Integer.hashCode(socketConnectTimeoutMs);
result = 31 * result + Integer.hashCode(mqttConnectTimeoutMs);
result = 31 * result + java9.util.Objects.hashCode(localAddress);
result = 31 * result + java9.util.Objects.hashCode(sslConfig);
result = 31 * result + java9.util.Objects.hashCode(webSocketConfig);
result = 31 * result + java9.util.Objects.hashCode(proxyConfig);
result = 31 * result + Integers.hashCode(socketConnectTimeoutMs);
result = 31 * result + Integers.hashCode(mqttConnectTimeoutMs);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java9.util.function.Function;

import static com.hivemq.client.mqtt.MqttClient.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

import java.net.InetSocketAddress;
import java.util.Objects;
import java.util.Optional;

import java9.lang.Integers;
import java9.util.Optional;

/**
* @author Silvio Giebl
Expand Down Expand Up @@ -106,9 +108,9 @@ public boolean equals(final @Nullable Object o) {
public int hashCode() {
int result = protocol.hashCode();
result = 31 * result + address.hashCode();
result = 31 * result + Objects.hashCode(username);
result = 31 * result + Objects.hashCode(password);
result = 31 * result + Integer.hashCode(handshakeTimeoutMs);
result = 31 * result + java9.util.Objects.hashCode(username);
result = 31 * result + java9.util.Objects.hashCode(password);
result = 31 * result + Integers.hashCode(handshakeTimeoutMs);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java9.util.function.Function;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java9.lang.Integers;

/**
* @author David Katz
* @author Christian Hoff
Expand Down Expand Up @@ -91,7 +93,7 @@ public int hashCode() {
int result = serverPath.hashCode();
result = 31 * result + queryString.hashCode();
result = 31 * result + subprotocol.hashCode();
result = 31 * result + Integer.hashCode(handshakeTimeoutMs);
result = 31 * result + Integers.hashCode(handshakeTimeoutMs);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java9.util.function.Function;

/**
* @author Silvio Giebl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public boolean equals(final @Nullable Object o) {
public int hashCode() {
int result = Boolean.hashCode(allowServerReAuth);
result = 31 * result + Boolean.hashCode(validatePayloadFormat);
result = 31 * result + Objects.hashCode(interceptors);
result = 31 * result + java9.util.Objects.hashCode(interceptors);
return result;
}
}
Loading