Annotation Type GetValue
-
@Target(PARAMETER) @Retention(RUNTIME) public @interface GetValue
A parameter source annotation that gets a value for a certain data key.This value can be taken from the event cause's first
ValueContainer
, or any preceding parameter that inherits fromValueContainer
.When looking for a value, searching will start from the parameter immediately before the annotated one, moving backwards and checking the first
ValueContainer
in the event cause last.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String
value
The name of the field incontainer()
providing this key.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class<?>
container
The holder class to fetch keys from.
-
-
-
Element Detail
-
value
java.lang.String value
The name of the field incontainer()
providing this key.This field must be static and have a value of type
Key
- Returns:
- the name of the key field to require
-
-
-
container
java.lang.Class<?> container
The holder class to fetch keys from.- Returns:
- the key container, by default
Keys
- Default:
- org.spongepowered.api.data.Keys.class
-
-