Package org.spongepowered.api.event
Class Cause.Builder
- java.lang.Object
-
- org.spongepowered.api.event.Cause.Builder
-
- All Implemented Interfaces:
Buildable.Builder<Cause>,Builder<Cause,Cause.Builder>,CopyableBuilder<Cause,Cause.Builder>,ResettableBuilder<Cause,Cause.Builder>
- Enclosing class:
- Cause
public static final class Cause.Builder extends Object implements Builder<Cause,Cause.Builder>, CopyableBuilder<Cause,Cause.Builder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Cause.Builderappend(Object cause)Appends the specified object to the cause.Cause.BuilderappendAll(Collection<Object> causes)Appends all specified objects onto the cause.Causebuild()Causebuild(EventContext ctx)Constructs a newCausewith information added to the builder.Cause.Builderfrom(Cause value)Resets this builder to the values of the given built object.Cause.Builderinsert(int position, Object cause)Inserts the specified object into the cause.Cause.Builderreset()Resets this builder to a "default" state such that there is no remaining data to set.
-
-
-
Method Detail
-
append
public Cause.Builder append(Object cause)
Appends the specified object to the cause.- Parameters:
cause- The object to append to the cause.- Returns:
- The modified builder, for chaining
-
insert
public Cause.Builder insert(int position, Object cause)
Inserts the specified object into the cause.- Parameters:
position- The position to insert intocause- The object to insert into the cause- Returns:
- The modified builder, for chaining
-
appendAll
public Cause.Builder appendAll(Collection<Object> causes)
Appends all specified objects onto the cause.- Parameters:
causes- The objects to add onto the cause- Returns:
- The modified builder, for chaining
-
from
public Cause.Builder from(Cause value)
Description copied from interface:CopyableBuilderResets this builder to the values of the given built object.- Specified by:
fromin interfaceCopyableBuilder<Cause,Cause.Builder>- Parameters:
value- The built object- Returns:
- This builder, for chaining
-
reset
public Cause.Builder 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<Cause,Cause.Builder>- Specified by:
resetin interfaceResettableBuilder<Cause,Cause.Builder>- Returns:
- This builder, for chaining
-
build
public Cause build()
- Specified by:
buildin interfaceBuildable.Builder<Cause>
-
build
public Cause build(EventContext ctx)
Constructs a newCausewith information added to the builder.- Parameters:
ctx- The context to build the cause with- Returns:
- The built cause
-
-