Package org.spongepowered.api.event
Interface EventContextKey<T>
- 
- Type Parameters:
- T- The type of the value stored with this key
 - All Superinterfaces:
- Keyed,- ResourceKeyed
 
 @CatalogedBy(EventContextKeys.class) public interface EventContextKey<T> extends ResourceKeyed A key for values in theEventContext.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceEventContextKey.Builder<T>
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.reflect.TypeallowedType()Gets the allowed type for the value of this key.static EventContextKey.Builder<?>builder()Creates a builder to be used for creating a newEventContextKey.Tcast(java.lang.Object value)Cast the provided value to the value type.booleanisInstance(java.lang.Object value)Return whether the value is an instance of this key's value type.- 
Methods inherited from interface org.spongepowered.api.ResourceKeyedkey
 
- 
 
- 
- 
- 
Method Detail- 
builderstatic EventContextKey.Builder<?> builder() Creates a builder to be used for creating a newEventContextKey.- Returns:
- The constructed builder
 
 - 
allowedTypejava.lang.reflect.Type allowedType() Gets the allowed type for the value of this key.This is a concrete type equal to the parameter T- Returns:
- The allowed type
 
 - 
isInstanceboolean isInstance(java.lang.Object value) Return whether the value is an instance of this key's value type.- Parameters:
- value- value to check
- Returns:
- if instance
 
 - 
castT cast(java.lang.Object value) Cast the provided value to the value type.- Parameters:
- value- value
- Returns:
- the casted value
- Throws:
- java.lang.ClassCastException- if- valueis not of the correct type
 
 
- 
 
-