Package org.opencypher.tools
Class TypedArgument
- java.lang.Object
-
- org.opencypher.tools.TypedArgument
-
public final class TypedArgument extends Object
Utility class used inReflectionto 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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TypedArgumenttyped(Class<?> type, Object value)Factory method.static Class<?>[]types(TypedArgument... arguments)Extract the parameter types from an array ofTypedArguments.static Object[]values(TypedArgument... arguments)Extract the argument values from an array ofTypedArguments.
-
-
-
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 ofTypedArguments.- 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 ofTypedArguments.- Parameters:
arguments- the arguments to extract the values from.- Returns:
- the values of the arguments.
-
-