Annotation Interface Has
Filters a parameter in an event
@Listener
method to only
one that has a value for certain data.
The parameter type must be DataHolder
or one of its subtypes.
This is a filtering annotation, meaning it needs to be used in conjunction with one of the source annotations on a parameter.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe name of the field incontainer()
providing this key. -
Optional Element Summary
Optional Elements
-
Element Details
-
container
Class<?> containerThe holder class to fetch keys from.- Returns:
- the key container, by default
Keys
- Default:
org.spongepowered.api.data.Keys.class
-
value
String valueThe 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
-
inverse
boolean inverseIf true then the behavior of this filter is reversed and the data holders having the specified key are excluded.- Returns:
- if the parameter filter is reversed
- Default:
false
-