Class EventContext.Builder
java.lang.Object
org.spongepowered.api.event.EventContext.Builder
- All Implemented Interfaces:
AbstractBuilder<EventContext>, Builder<EventContext, EventContext.Builder>, CopyableBuilder<EventContext, EventContext.Builder>, ResettableBuilder<EventContext, EventContext.Builder>
- Enclosing class:
EventContext
public static final class EventContext.Builder
extends Object
implements Builder<EventContext, EventContext.Builder>, CopyableBuilder<EventContext, EventContext.Builder>
-
Method Summary
Modifier and TypeMethodDescriptionadd(Supplier<EventContextKey<T>> key, T value) Adds the given context key value pair to the context.add(EventContextKey<T> key, T value) Adds the given context key value pair to the context.build()Creates a newEventContext.from(EventContext value) Resets this builder to the values of the given built object.reset()Resets this builder to a "default" state such that there is no remaining data to set.
-
Method Details
-
add
Adds the given context key value pair to the context.- Type Parameters:
T- The type of the value stored with the key- Parameters:
key- The keyvalue- The value- Returns:
- This builder, for chaining
-
add
Adds the given context key value pair to the context.- Type Parameters:
T- The type of the value stored with the key- Parameters:
key- The keyvalue- The value- Returns:
- This builder, for chaining
-
from
Description copied from interface:CopyableBuilderResets this builder to the values of the given built object.- Specified by:
fromin interfaceCopyableBuilder<EventContext, EventContext.Builder>- Parameters:
value- The built object- Returns:
- This builder, for chaining
-
reset
Description copied from interface:BuilderResets this builder to a "default" state such that there is no remaining data to set. This is to be the presumed "default" state.- Specified by:
resetin interfaceBuilder<EventContext, EventContext.Builder>- Specified by:
resetin interfaceResettableBuilder<EventContext, EventContext.Builder>- Returns:
- This builder, for chaining
-
build
Creates a newEventContext.- Specified by:
buildin interfaceAbstractBuilder<EventContext>- Returns:
- The EventContext
-