Class TypedArgument


  • public final class TypedArgument
    extends Object
    Utility class used in Reflection to specify the type of a parameter along with the corresponding argument value. This allows passing an instance of a more derived type, or passing null and still having the type of the parameter.
    • Method Detail

      • typed

        public static TypedArgument typed​(Class<?> type,
                                          Object value)
        Factory method.
        Parameters:
        type - the type of the parameter.
        value - the value of the argument.
        Returns:
        a new instance.
      • types

        public static Class<?>[] types​(TypedArgument... arguments)
        Extract the parameter types from an array of TypedArguments.
        Parameters:
        arguments - the arguments to extract the types from.
        Returns:
        the types of the arguments.
      • values

        public static Object[] values​(TypedArgument... arguments)
        Extract the argument values from an array of TypedArguments.
        Parameters:
        arguments - the arguments to extract the values from.
        Returns:
        the values of the arguments.