Class Cause.Builder

java.lang.Object
org.spongepowered.api.event.Cause.Builder
All Implemented Interfaces:
AbstractBuilder<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 Details

    • 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 into
      cause - 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: CopyableBuilder
      Resets this builder to the values of the given built object.
      Specified by:
      from in interface CopyableBuilder<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 interface Builder<Cause,Cause.Builder>
      Specified by:
      reset in interface ResettableBuilder<Cause,Cause.Builder>
      Returns:
      This builder, for chaining
    • build

      public Cause build()
      Specified by:
      build in interface AbstractBuilder<Cause>
    • build

      public Cause build(EventContext ctx)
      Constructs a new Cause with information added to the builder.
      Parameters:
      ctx - The context to build the cause with
      Returns:
      The built cause