Class EndpointMethod


  • public class EndpointMethod
    extends Object
    A class which takes care to resolved any parameterized types for endpoints. That way we can support inheritance from generic base classes without needing to override and specialize the method when it has a sensible default.
    • Method Detail

      • getClassFromType

        public static Class<?> getClassFromType​(Type type)
        Returns the class associated with type. If this is a parameterized type or generic array, then its raw or component type, respectively, will be returned. Null is returned if type is not implemented by a Class<?>, ParameterizedType, or GenericArrayType object.
      • getEndpointClass

        public Class<?> getEndpointClass()
        Returns the endpoint class.
      • getMethod

        public Method getMethod()
        Returns the underlying method object.
      • getReturnType

        public com.google.common.reflect.TypeToken<?> getReturnType()
        Returns the return type of the method.
      • getParameterTypes

        public com.google.common.reflect.TypeToken<?>[] getParameterTypes()
        Returns the parameter types of the method.
      • getParameterClasses

        public Class<?>[] getParameterClasses()
        Returns the parameter classes of the method.
      • create

        public static EndpointMethod create​(Class<?> endpointClass,
                                            Method method,
                                            com.google.common.reflect.TypeToken<?> declaringClass)
        Creates an EndpointMethod using type information from the given TypeToken.
        Parameters:
        method - Must not have wildcard types (all generic types must be resolvable to a concrete type using the given TypeToken).
        declaringClass - A token for the method's declaring class.
      • create

        public static EndpointMethod create​(Class<?> endpointClass,
                                            Method method)
        Creates an EndpointMethod using type information directly available from the method's declaring class.
        Parameters:
        method - Must not have wildcard types (all generic types must be resolvable to a concrete type using type information from the method's declaring class).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getParameterNames

        public List<String> getParameterNames()
      • setParameterNames

        public void setParameterNames​(List<String> parameterNames)