Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface Parameters

Imports
jakarta.enterprise.invoke.Invoker

A String-keyed parameter map. The parameter mappings are defined by a synthetic component builder. The CDI container passes the parameter map to functions defined by the same synthetic component builder, whenever it needs to invoke those functions. That is: Parameter values are transferred from the builder to the Parameters-accepting function without a change. For example, if the builder defines an int parameter, it must be looked up as int and cannot be looked up as long.

Values of primitive types may be looked up either using the primitive type (such as int.class), or using the corresponding wrapper type (Integer.class). The return value is always of the wrapper type, so that null can be returned when the parameter does not exist. Note that this does not apply to arrays of primitive types; an int[] cannot be looked up as Integer[]. This is because arrays are reference types and so null can be returned.

Class-typed parameters are available as instances of Class, even if an instance of ClassInfo was passed to the builder.

Annotation-typed parameters are available as instances of the annotation type, even if an instance of AnnotationInfo was passed to the builder.

Invoker-typed parameters are available as instances of Invoker, even though an instance of InvokerInfo was passed to the builder.

Method Summary

Modifier and TypeMethod and Description
public <
the parameter type
T
>
T

Returns:

the parameter value, or null if parameter with given key does not exist
get
(String
the parameter key, must not be null
key
,
Class<T>
the parameter type, must not be null
type
)

Returns the value of a parameter with given key.

public <
the parameter type
T
>
T

Returns:

the parameter value, or defaultValue if parameter with given key does not exist
get
(String
the parameter key, must not be null
key
,
Class<T>
the parameter type, must not be null
type
,
T
the value to return if parameter with given key does not exist
defaultValue
)

Returns the value of a parameter with given key.

Method Detail

getback to summary
public <T> T get(String key, Class<T> type)

Returns the value of a parameter with given key. The value is expected to be of given type.

Parameters
<T>
the parameter type
key:String

the parameter key, must not be null

type:Class<T>

the parameter type, must not be null

Returns:T

the parameter value, or null if parameter with given key does not exist

Exceptions
ClassCastException:
if the parameter exists, but is of a different type
getback to summary
public <T> T get(String key, Class<T> type, T defaultValue)

Returns the value of a parameter with given key. The value is expected to be of given type. If the parameter does not exist, returns defaultValue.

Parameters
<T>
the parameter type
key:String

the parameter key, must not be null

type:Class<T>

the parameter type, must not be null

defaultValue:T

the value to return if parameter with given key does not exist

Returns:T

the parameter value, or defaultValue if parameter with given key does not exist

Exceptions
ClassCastException:
if the parameter exists, but is of a different type