mirror of https://github.com/grpc/grpc-java.git
core: promote experimental methods in MethodDescriptor
This commit is contained in:
parent
5408b92fd4
commit
ce3a94bacc
|
|
@ -31,6 +31,8 @@
|
|||
|
||||
package io.grpc;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
|
@ -197,7 +199,6 @@ public class MethodDescriptor<ReqT, RespT> {
|
|||
* @param requestMarshaller the marshaller used to encode and decode requests
|
||||
* @param responseMarshaller the marshaller used to encode and decode responses
|
||||
*/
|
||||
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1774")
|
||||
public static <RequestT, ResponseT> MethodDescriptor<RequestT, ResponseT> create(
|
||||
MethodType type, String fullMethodName,
|
||||
Marshaller<RequestT> requestMarshaller,
|
||||
|
|
@ -345,9 +346,10 @@ public class MethodDescriptor<ReqT, RespT> {
|
|||
* @param fullServiceName the fully qualified service name that is prefixed with the package name
|
||||
* @param methodName the short method name
|
||||
*/
|
||||
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1774")
|
||||
public static String generateFullMethodName(String fullServiceName, String methodName) {
|
||||
return fullServiceName + "/" + methodName;
|
||||
return checkNotNull(fullServiceName, "fullServiceName")
|
||||
+ "/"
|
||||
+ checkNotNull(methodName, "methodName");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -355,10 +357,9 @@ public class MethodDescriptor<ReqT, RespT> {
|
|||
* {@code null} if the input is malformed, but you cannot rely on it for the validity of the
|
||||
* input.
|
||||
*/
|
||||
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1774")
|
||||
@Nullable
|
||||
public static String extractFullServiceName(String fullMethodName) {
|
||||
int index = fullMethodName.lastIndexOf('/');
|
||||
int index = checkNotNull(fullMethodName, "fullMethodName").lastIndexOf('/');
|
||||
if (index == -1) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue