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
Nested Classes -
Method Summary
Modifier and TypeMethodDescription<T> TgetArgument(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.List<org.springframework.aot.hint.TypeReference> Return the types of the arguments used for the current reflection invocation.List<org.springframework.aot.hint.TypeReference> getArgumentTypes(int index) Return the types of the arguments used for the current reflection invocation, starting from the given index.Return the category ofRuntimeHintsthis invocation relates to.<T> TReturn the instance of the object being invoked.org.springframework.aot.hint.TypeReferenceReturn the Type reference of the object being invoked.Return a simple representation of the method invoked here.<T> @Nullable TReturn the value actually returned by the invoked method.Return the stack trace of the current invocation.booleanisStatic()Return whether the current invocation is static.booleanmatches(org.springframework.aot.hint.RuntimeHints hints) Whether the given hints cover the current invocation.static RecordedInvocation.Builderof(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 ofRuntimeHintsthis 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
public org.springframework.aot.hint.TypeReference 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:
trueif the invocation is static
-
getArguments
-
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
public boolean matches(org.springframework.aot.hint.RuntimeHints hints) 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
-