mirror of https://github.com/grpc/grpc-java.git
Change AbstractServiceDescriptor.methods() to Collection. Resolves #573
This commit is contained in:
parent
3ee5b5a752
commit
c73b75e477
|
|
@ -79,7 +79,7 @@ public class TestServiceGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
unaryCall,
|
||||
streamingCall);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class WorkerGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
runTest,
|
||||
runServer);
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ static void PrintServiceDescriptor(
|
|||
p->Print(
|
||||
*vars,
|
||||
"@$Override$\n"
|
||||
"public $ImmutableList$<$MethodDescriptor$<?, ?>> methods() {\n");
|
||||
"public $Collection$<$MethodDescriptor$<?, ?>> methods() {\n");
|
||||
p->Indent();
|
||||
p->Print(
|
||||
*vars,
|
||||
|
|
@ -674,6 +674,7 @@ void GenerateService(const ServiceDescriptor* service,
|
|||
vars["AbstractServiceDescriptor"] =
|
||||
"io.grpc.stub.AbstractServiceDescriptor";
|
||||
vars["ImmutableList"] = "com.google.common.collect.ImmutableList";
|
||||
vars["Collection"] = "java.util.Collection";
|
||||
vars["MethodDescriptor"] = "io.grpc.MethodDescriptor";
|
||||
vars["ProtoUtils"] = "io.grpc.protobuf.ProtoUtils";
|
||||
vars["NanoUtils"] = "io.grpc.protobuf.nano.NanoUtils";
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public class TestServiceGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
unaryCall,
|
||||
streamingOutputCall,
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ public class TestServiceGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
unaryCall,
|
||||
streamingOutputCall,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class GreeterGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
sayHello);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class RouteGuideGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
getFeature,
|
||||
listFeatures,
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class TestServiceGrpc {
|
|||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
|
||||
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
|
||||
emptyCall,
|
||||
unaryCall,
|
||||
|
|
|
|||
|
|
@ -31,10 +31,9 @@
|
|||
|
||||
package io.grpc.stub;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import io.grpc.MethodDescriptor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -45,9 +44,9 @@ import java.util.Map;
|
|||
public abstract class AbstractServiceDescriptor<T extends AbstractServiceDescriptor<?>> {
|
||||
|
||||
/**
|
||||
* Returns the list of operations defined in the stub configuration.
|
||||
* Returns an immutable collection of methods defined in the stub configuration.
|
||||
*/
|
||||
public abstract ImmutableList<MethodDescriptor<?, ?>> methods();
|
||||
public abstract Collection<MethodDescriptor<?, ?>> methods();
|
||||
|
||||
/**
|
||||
* Returns a new stub configuration for the provided method configurations.
|
||||
|
|
|
|||
Loading…
Reference in New Issue