All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.prettypb.rpc.info.MethodInfo Maven / Gradle / Ivy

There is a newer version: 0.3.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy