Package org.springframework.aot.agent
Class RecordedInvocation
java.lang.Object
org.springframework.aot.agent.RecordedInvocation
Record of an invocation of a method relevant to
RuntimeHints
.
The RuntimeHintsAgent
instruments bytecode and intercepts invocations of
specific methods
; invocations are recorded during test execution
to match them against an existing RuntimeHints
configuration.
- Since:
- 6.0
- Author:
- Brian Clozel
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
getArgument
(int index) Return the argument value at the given index used for the current reflection invocation.Return the argument values used for the current reflection invocation.Return the types of the arguments used for the current reflection invocation.getArgumentTypes
(int index) Return the types of the arguments used for the current reflection invocation, starting from the given index.Return the category ofRuntimeHints
this invocation relates to.<T> T
Return the instance of the object being invoked.Return the Type reference of the object being invoked.Return a simple representation of the method invoked here.<T> T
Return the value actually returned by the invoked method.Return the stack trace of the current invocation.boolean
isStatic()
Return whether the current invocation is static.boolean
matches
(RuntimeHints hints) Whether the given hints cover the current invocation.static RecordedInvocation.Builder
of
(org.springframework.aot.agent.InstrumentedMethod instrumentedMethod) Initialize a builder for the givenInstrumentedMethod
.toString()
-
Method Details
-
of
public static RecordedInvocation.Builder of(org.springframework.aot.agent.InstrumentedMethod instrumentedMethod) Initialize a builder for the givenInstrumentedMethod
.- Parameters:
instrumentedMethod
- the instrumented method- Returns:
- a builder
-
getHintType
Return the category ofRuntimeHints
this invocation relates to.- Returns:
- the hint type
-
getMethodReference
Return a simple representation of the method invoked here.- Returns:
- the method reference
-
getStackFrames
Return the stack trace of the current invocation.- Returns:
- the stack frames
-
getInstance
public <T> T getInstance()Return the instance of the object being invoked.- Returns:
- the object instance
- Throws:
IllegalStateException
- in case of static invocations (there is nothis
)
-
getInstanceTypeReference
Return the Type reference of the object being invoked.- Returns:
- the instance type reference, or
null
- Throws:
IllegalStateException
- in case of static invocations (there is nothis
)
-
isStatic
public boolean isStatic()Return whether the current invocation is static.- Returns:
true
if the invocation is static
-
getArguments
Return the argument values used for the current reflection invocation.- Returns:
- the invocation arguments
-
getArgument
public <T> T getArgument(int index) Return the argument value at the given index used for the current reflection invocation.- Parameters:
index
- the parameter index- Returns:
- the argument at the given index
-
getArgumentTypes
Return the types of the arguments used for the current reflection invocation.- Returns:
- the argument types
-
getArgumentTypes
Return the types of the arguments used for the current reflection invocation, starting from the given index.- Returns:
- the argument types, starting at the given index
-
getReturnValue
Return the value actually returned by the invoked method.- Returns:
- the value returned by the invocation
-
matches
Whether the given hints cover the current invocation.If the given hint doesn't match this invocation might fail at execution time depending on the target runtime.
- Returns:
- whether the given hints match
-
toString
-