Package org.spongepowered.api.event
Class Cause.Builder
- java.lang.Object
-
- org.spongepowered.api.event.Cause.Builder
-
- All Implemented Interfaces:
AbstractBuilder<Cause>
,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 java.lang.Object implements Builder<Cause,Cause.Builder>, CopyableBuilder<Cause,Cause.Builder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Cause.Builder
append(java.lang.Object cause)
Appends the specified object to the cause.Cause.Builder
appendAll(java.util.Collection<java.lang.Object> causes)
Appends all specified objects onto the cause.Cause
build()
Cause
build(EventContext ctx)
Constructs a newCause
with information added to the builder.Cause.Builder
from(Cause value)
Resets this builder to the values of the given built object.Cause.Builder
insert(int position, java.lang.Object cause)
Inserts the specified object into the cause.Cause.Builder
reset()
Resets this builder to a "default" state such that there is no remaining data to set.
-
-
-
Method Detail
-
append
public Cause.Builder append(java.lang.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, java.lang.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(java.util.Collection<java.lang.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:CopyableBuilder
Resets this builder to the values of the given built object.- Specified by:
from
in interfaceCopyableBuilder<Cause,Cause.Builder>
- Parameters:
value
- The built object- Returns:
- This builder, for chaining
-
reset
public Cause.Builder reset()
Description copied from interface:Builder
Resets 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:
reset
in interfaceBuilder<Cause,Cause.Builder>
- Specified by:
reset
in interfaceResettableBuilder<Cause,Cause.Builder>
- Returns:
- This builder, for chaining
-
build
public Cause build()
- Specified by:
build
in interfaceAbstractBuilder<Cause>
- Specified by:
build
in interfaceBuildable.Builder<Cause>
-
build
public Cause build(EventContext ctx)
Constructs a newCause
with information added to the builder.- Parameters:
ctx
- The context to build the cause with- Returns:
- The built cause
-
-