net.dongliu.prettypb.rpc.info.MethodInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prettypb-rpc Show documentation
Show all versions of prettypb-rpc Show documentation
proto rpc libs, compatible with proto-rpc-pro
package net.dongliu.prettypb.rpc.info;
import java.lang.reflect.Method;
/**
* Rpc service method info.
* For client side use, implMethod is null
*
* @author dongliu
*/
public class MethodInfo {
/**
* method name
*/
private final String name;
/**
* the interface method
*/
private final Method interfaceMethod;
/**
* the impl method.for client side, this is null
*/
private Method implMethod;
/**
* rpc request type
*/
private final Class> requestType;
/**
* rpc response type
*/
private final Class> responseType;
/**
* service this method belong to
*/
private ServiceInfo serviceInfo;
public MethodInfo(String name, Method interfaceMethod, Method implMethod,
Class> requestType, Class> responseType) {
this.name = name;
this.interfaceMethod = interfaceMethod;
this.implMethod = implMethod;
this.requestType = requestType;
this.responseType = responseType;
}
public String getName() {
return name;
}
public String getFullName() {
return serviceInfo.getName() + "." + this.name;
}
public String getServiceName() {
return serviceInfo.getName();
}
public ServiceInfo getServiceInfo() {
return serviceInfo;
}
public Method getInterfaceMethod() {
return interfaceMethod;
}
public void setImplMethod(Method implMethod) {
this.implMethod = implMethod;
}
public Method getImplMethod() {
return implMethod;
}
public Class> getRequestType() {
return requestType;
}
public Class> getResponseType() {
return responseType;
}
public void setServiceInfo(ServiceInfo serviceInfo) {
this.serviceInfo = serviceInfo;
}
}