@PublicEvolving @Retention(value=RUNTIME) @Target(value={TYPE,METHOD,FIELD,PARAMETER}) public @interface ArgumentHint
An ArgumentHint
can be used to provide hints about the name, optionality, and data
type of argument.
It combines the functionality of FunctionHint.argumentNames()
and DataTypeHint
annotations to conveniently group argument-related information together in function declarations.
@ArgumentHint(name = "in1", type = @DataTypeHint("STRING"), isOptional = false
is an
argument with the type String, named in1, and cannot be omitted when calling.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
isOptional
Specifies whether the argument is optional or required.
|
String |
name
The name of the argument.
|
DataTypeHint |
type
The data type hint for the argument.
|
public abstract String name
This can be used to provide a descriptive name for the argument.
public abstract boolean isOptional
If set to true
, the argument is considered optional.And if the user does not
specify this parameter when calling, 'null' will be passed in. By default, an argument is
considered required.
public abstract DataTypeHint type
This can be used to provide additional information about the expected data type of the
argument. The DataTypeHint
annotation can be used to specify the data type explicitly
or provide hints for the reflection-based extraction of the data type.
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.