java.lang.Object
com.github.thought2code.mcp.annotated.reflect.MethodCache

public final class MethodCache extends Object
This class caches information about a Java method, including its name, declaring class, parameters, and annotations.
Author:
codeboyzhou
  • Constructor Details

    • MethodCache

      public MethodCache(Method method)
      Creates a new instance of MethodCache with the specified method.
      Parameters:
      method - the method to cache
  • Method Details

    • of

      public static MethodCache of(Method method)
      Creates a new instance of MethodCache with the specified method.
      Parameters:
      method - the method to cache
      Returns:
      a new instance of MethodCache with the specified method
    • getMethod

      public Method getMethod()
      Returns the method cached by this MethodCache instance.
      Returns:
      the method cached by this MethodCache instance
    • getMethodName

      public String getMethodName()
      Returns the name of the cached method.
      Returns:
      the name of the cached method
    • getDeclaringClass

      public Class<?> getDeclaringClass()
      Returns the class that declares the cached method.
      Returns:
      the class that declares the cached method
    • getParameters

      public Parameter[] getParameters()
      Returns the parameters of the cached method.
      Returns:
      the parameters of the cached method
    • getReturnType

      public Class<?> getReturnType()
      Returns the return type of the cached method.
      Returns:
      the return type of the cached method
    • getMethodSignature

      public String getMethodSignature()
      Returns the signature of the cached method.
      Returns:
      the signature of the cached method
    • getMcpResourceAnnotation

      public McpResource getMcpResourceAnnotation()
      Returns the annotation McpResource on the cached method.
      Returns:
      the annotation McpResource on the cached method
    • getMcpPromptAnnotation

      public McpPrompt getMcpPromptAnnotation()
      Returns the annotation McpPrompt on the cached method.
      Returns:
      the annotation McpPrompt on the cached method
    • getMcpToolAnnotation

      public McpTool getMcpToolAnnotation()
      Returns the annotation McpTool on the cached method.
      Returns:
      the annotation McpTool on the cached method
    • getMcpPromptCompletionAnnotation

      public McpPromptCompletion getMcpPromptCompletionAnnotation()
      Returns the annotation McpPromptCompletion on the cached method.
      Returns:
      the annotation McpPromptCompletion on the cached method
    • getMcpResourceCompletionAnnotation

      public McpResourceCompletion getMcpResourceCompletionAnnotation()
      Returns the annotation McpResourceCompletion on the cached method.
      Returns:
      the annotation McpResourceCompletion on the cached method
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object