Modifier and Type | Method and Description |
---|---|
static <A> Argument<A> |
argument(A value)
Factory method for arguments.
|
static <T,V extends T> |
argument(Class<T> type,
V value)
Creates a new argument of the given type with the given value.
|
Class<T> |
getType()
Returns the argument's type.
|
T |
getValue()
Returns the value of the argument.
|
static <A> Argument<A> |
nullArgument(Class<A> type)
Creates a new null argument of the given type.
|
public static <A> Argument<A> argument(A value)
A
- the type of the argument.value
- the value to be wrapped by the new argument object. Must not be null
! If you want to create
a null argument use nullArgument(Class)
instead.value.getClass()
public static <A> Argument<A> nullArgument(Class<A> type)
argument( type, null )
.A
- the type of argument.type
- the type of the new argument. Must not be null
!value == null
.public static <T,V extends T> Argument<T> argument(Class<T> type, V value)
T
- the type of the argument.V
- the type of the value of the argument.type
- the type of the new argument. Must not be null
!value
- the value of the new argument.public Class<T> getType()
getValue()
depending on how the argument was created. For example:
argument( Number.class, Integer.valueOf( 4 ) );
will create an argument with an Integer as Value but Number.class as type.Copyright © 2012–2014 The Apache Software Foundation. All rights reserved.