Class AbstractPunishment

java.lang.Object
de.jvstvshd.necrify.common.punishment.AbstractPunishment
All Implemented Interfaces:
de.jvstvshd.necrify.api.punishment.Punishment, de.jvstvshd.necrify.api.punishment.util.ReasonHolder
Direct Known Subclasses:
AbstractTemporalPunishment, NecrifyKick

public abstract class AbstractPunishment extends Object implements de.jvstvshd.necrify.api.punishment.Punishment
  • Field Details

  • Constructor Details

    • AbstractPunishment

      public AbstractPunishment(@NotNull @NotNull de.jvstvshd.necrify.api.user.NecrifyUser user, @NotNull @NotNull net.kyori.adventure.text.Component reason, @NotNull @NotNull UUID punishmentUuid, @NotNull @NotNull AbstractNecrifyPlugin plugin, @Nullable @Nullable de.jvstvshd.necrify.api.punishment.Punishment successor, @Nullable @Nullable LocalDateTime issuedAt)
  • Method Details

    • getReason

      @NotNull public @NotNull net.kyori.adventure.text.Component getReason()
      Specified by:
      getReason in interface de.jvstvshd.necrify.api.punishment.util.ReasonHolder
    • getExecutor

      public ExecutorService getExecutor()
    • executeAsync

      protected <T> CompletableFuture<T> executeAsync(Callable<T> task, ExecutorService executorService)
    • getUser

      @NotNull public @NotNull de.jvstvshd.necrify.api.user.NecrifyUser getUser()
      Specified by:
      getUser in interface de.jvstvshd.necrify.api.punishment.Punishment
    • getPunishmentUuid

      @NotNull public @NotNull UUID getPunishmentUuid()
      Specified by:
      getPunishmentUuid in interface de.jvstvshd.necrify.api.punishment.Punishment
    • convertReason

      protected String convertReason(net.kyori.adventure.text.Component component)
    • isValid

      public boolean isValid()
    • punish

      public final CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> punish()
      Specified by:
      punish in interface de.jvstvshd.necrify.api.punishment.Punishment
    • cancel

      public final CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> cancel()
      Specified by:
      cancel in interface de.jvstvshd.necrify.api.punishment.Punishment
    • applyPunishment

      protected abstract CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> applyPunishment()
    • applyCancellation

      protected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> applyCancellation()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • checkValidity

      protected void checkValidity()
    • getMessageProvider

      @NotNull public @NotNull de.jvstvshd.necrify.api.message.MessageProvider getMessageProvider()
    • getUuid

      @NotNull public @NotNull UUID getUuid()
      Specified by:
      getUuid in interface de.jvstvshd.necrify.api.punishment.Punishment
    • getEventDispatcher

      @NotNull public @NotNull de.jvstvshd.necrify.api.event.EventDispatcher getEventDispatcher()
    • getPlugin

      @NotNull public @NotNull AbstractNecrifyPlugin getPlugin()
    • hasSuccessor

      public boolean hasSuccessor()
      Specified by:
      hasSuccessor in interface de.jvstvshd.necrify.api.punishment.Punishment
    • getSuccessor

      @NotNull public @NotNull de.jvstvshd.necrify.api.punishment.Punishment getSuccessor()
      Specified by:
      getSuccessor in interface de.jvstvshd.necrify.api.punishment.Punishment
    • getCreationTime

      @NotNull public @NotNull LocalDateTime getCreationTime()
      Specified by:
      getCreationTime in interface de.jvstvshd.necrify.api.punishment.Punishment
    • getPredecessor

      @Nullable public @Nullable de.jvstvshd.necrify.api.punishment.Punishment getPredecessor()
      Specified by:
      getPredecessor in interface de.jvstvshd.necrify.api.punishment.Punishment
    • hasBeenCreated

      public boolean hasBeenCreated()
      Specified by:
      hasBeenCreated in interface de.jvstvshd.necrify.api.punishment.Punishment