Class MethodInvocationUtilities
java.lang.Object
it.uniroma2.art.semanticturkey.aop.MethodInvocationUtilities
Utility class related to the AOP
MethodInvocation
.- Author:
- Manuel Fiorelli
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
S extends Annotation>
Optional<org.apache.commons.lang3.tuple.ImmutablePair<T,S>> getFirstAnnotatedArgument
(org.aopalliance.intercept.MethodInvocation invocation, Class<S> annotationType, Class<T> expectedParameterType, boolean ignoreTypeMismatches) Returns first parameter marked with the given annotation.static <T> Optional<T>
getValueOfFirstAnnotatedParameter
(org.aopalliance.intercept.MethodInvocation invocation, Class<? extends Annotation> annotationType, Class<T> expectedParameterType) Returns the value of the first parameter marked with the given annotation
-
Constructor Details
-
MethodInvocationUtilities
public MethodInvocationUtilities()
-
-
Method Details
-
getValueOfFirstAnnotatedParameter
public static <T> Optional<T> getValueOfFirstAnnotatedParameter(org.aopalliance.intercept.MethodInvocation invocation, Class<? extends Annotation> annotationType, Class<T> expectedParameterType) Returns the value of the first parameter marked with the given annotation- Parameters:
invocation
-annotationType
-expectedParameterType
-- Returns:
-
getFirstAnnotatedArgument
public static <T,S extends Annotation> Optional<org.apache.commons.lang3.tuple.ImmutablePair<T,S>> getFirstAnnotatedArgument(org.aopalliance.intercept.MethodInvocation invocation, Class<S> annotationType, Class<T> expectedParameterType, boolean ignoreTypeMismatches) Returns first parameter marked with the given annotation. The return value is a pair consisting of the parameter value and the annotation.- Parameters:
invocation
-annotationType
-expectedParameterType
-ignoreTypeMismatches
-- Returns:
-