Class AbstractTemporalPunishment

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

public abstract class AbstractTemporalPunishment extends AbstractPunishment implements de.jvstvshd.necrify.api.punishment.TemporalPunishment
  • Constructor Details

    • AbstractTemporalPunishment

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

    • getDuration

      @NotNull public @NotNull de.jvstvshd.necrify.api.duration.PunishmentDuration getDuration()
      Specified by:
      getDuration in interface de.jvstvshd.necrify.api.punishment.TemporalPunishment
    • isOngoing

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

      public String toString()
      Overrides:
      toString in class AbstractPunishment
    • isValid

      public boolean isValid()
      Overrides:
      isValid in class AbstractPunishment
    • checkValidity

      protected void checkValidity()
      Overrides:
      checkValidity in class AbstractPunishment
    • change

      @NotNull public final @NotNull CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> change(@NotNull @NotNull de.jvstvshd.necrify.api.duration.PunishmentDuration newDuration, @Nullable @Nullable LocalDateTime creationTime, net.kyori.adventure.text.Component newReason) throws de.jvstvshd.necrify.api.PunishmentException
      Specified by:
      change in interface de.jvstvshd.necrify.api.punishment.TemporalPunishment
      Throws:
      de.jvstvshd.necrify.api.PunishmentException
    • applyCancellation

      protected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> applyCancellation() throws de.jvstvshd.necrify.api.PunishmentException
      Overrides:
      applyCancellation in class AbstractPunishment
      Throws:
      de.jvstvshd.necrify.api.PunishmentException
    • getType

      @NotNull public abstract @NotNull de.jvstvshd.necrify.api.punishment.StandardPunishmentType getType()
      Specified by:
      getType in interface de.jvstvshd.necrify.api.punishment.Punishment
    • applyPunishment

      protected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> applyPunishment() throws de.jvstvshd.necrify.api.PunishmentException
      Specified by:
      applyPunishment in class AbstractPunishment
      Throws:
      de.jvstvshd.necrify.api.PunishmentException
    • setSuccessor

      @NotNull public @NotNull CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> setSuccessor(@NotNull @NotNull de.jvstvshd.necrify.api.punishment.Punishment successor)
      Specified by:
      setSuccessor in interface de.jvstvshd.necrify.api.punishment.Punishment
    • totalDuration

      @NotNull public @NotNull de.jvstvshd.necrify.api.duration.PunishmentDuration totalDuration()
      Specified by:
      totalDuration in interface de.jvstvshd.necrify.api.punishment.TemporalPunishment