mirror of https://github.com/grpc/grpc-java.git
Add proper generics to ManagedChannelProvider
This commit is contained in:
parent
23e6318156
commit
e969a900a0
|
|
@ -31,8 +31,6 @@
|
||||||
|
|
||||||
package io.grpc;
|
package io.grpc;
|
||||||
|
|
||||||
import io.grpc.ManagedChannelProvider;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
|
@ -42,7 +40,7 @@ import java.util.concurrent.Executor;
|
||||||
* @param <T> The concrete type of this builder.
|
* @param <T> The concrete type of this builder.
|
||||||
*/
|
*/
|
||||||
public abstract class ManagedChannelBuilder<T extends ManagedChannelBuilder<T>> {
|
public abstract class ManagedChannelBuilder<T extends ManagedChannelBuilder<T>> {
|
||||||
public static ManagedChannelBuilder forAddress(String name, int port) {
|
public static ManagedChannelBuilder<?> forAddress(String name, int port) {
|
||||||
return ManagedChannelProvider.provider().builderForAddress(name, port);
|
return ManagedChannelProvider.provider().builderForAddress(name, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public abstract class ManagedChannelProvider {
|
||||||
/**
|
/**
|
||||||
* Creates a new builder with the given host and port.
|
* Creates a new builder with the given host and port.
|
||||||
*/
|
*/
|
||||||
protected abstract ManagedChannelBuilder builderForAddress(String name, int port);
|
protected abstract ManagedChannelBuilder<?> builderForAddress(String name, int port);
|
||||||
|
|
||||||
public static final class ProviderNotFoundException extends RuntimeException {
|
public static final class ProviderNotFoundException extends RuntimeException {
|
||||||
public ProviderNotFoundException(String msg) {
|
public ProviderNotFoundException(String msg) {
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ public class ManagedChannelProviderTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ManagedChannelBuilder builderForAddress(String host, int port) {
|
protected ManagedChannelBuilder<?> builderForAddress(String host, int port) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue