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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPunishment(@NotNull de.jvstvshd.necrify.api.user.NecrifyUser user, @NotNull net.kyori.adventure.text.Component reason, @NotNull UUID punishmentUuid, @NotNull AbstractNecrifyPlugin plugin, @Nullable de.jvstvshd.necrify.api.punishment.Punishment successor, @Nullable LocalDateTime issuedAt) -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> protected abstract CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> final CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> cancel()protected voidprotected StringconvertReason(net.kyori.adventure.text.Component component) final booleanprotected <T> CompletableFuture<T> executeAsync(Callable<T> task, ExecutorService executorService) @NotNull LocalDateTime@NotNull de.jvstvshd.necrify.api.event.EventDispatcher@NotNull de.jvstvshd.necrify.api.message.MessageProvider@NotNull AbstractNecrifyPlugin@Nullable de.jvstvshd.necrify.api.punishment.Punishment@NotNull UUID@NotNull net.kyori.adventure.text.Component@NotNull de.jvstvshd.necrify.api.punishment.Punishment@NotNull de.jvstvshd.necrify.api.user.NecrifyUsergetUser()@NotNull UUIDgetUuid()booleaninthashCode()booleanbooleanisValid()final CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> punish()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.jvstvshd.necrify.api.punishment.Punishment
change, getSuccessorOrNull, getType, isOngoing, setSuccessorMethods inherited from interface de.jvstvshd.necrify.api.punishment.util.ReasonHolder
createFullReason
-
Field Details
-
APPLY_PUNISHMENT
- See Also:
-
APPLY_CANCELLATION
- See Also:
-
APPLY_CHANGE
- See Also:
-
APPLY_SUCCESSOR
- See Also:
-
APPLY_TIMESTAMP_UPDATE
- See Also:
-
-
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:
getReasonin interfacede.jvstvshd.necrify.api.punishment.util.ReasonHolder
-
getExecutor
-
executeAsync
-
getUser
@NotNull public @NotNull de.jvstvshd.necrify.api.user.NecrifyUser getUser()- Specified by:
getUserin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
getPunishmentUuid
- Specified by:
getPunishmentUuidin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
convertReason
-
isValid
public boolean isValid() -
punish
- Specified by:
punishin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
cancel
- Specified by:
cancelin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
applyPunishment
protected abstract CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> applyPunishment() -
applyCancellation
-
toString
-
equals
-
hashCode
public int hashCode() -
checkValidity
protected void checkValidity() -
getMessageProvider
@NotNull public @NotNull de.jvstvshd.necrify.api.message.MessageProvider getMessageProvider() -
getUuid
- Specified by:
getUuidin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
getEventDispatcher
@NotNull public @NotNull de.jvstvshd.necrify.api.event.EventDispatcher getEventDispatcher() -
getPlugin
-
hasSuccessor
public boolean hasSuccessor()- Specified by:
hasSuccessorin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
getSuccessor
@NotNull public @NotNull de.jvstvshd.necrify.api.punishment.Punishment getSuccessor()- Specified by:
getSuccessorin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
getCreationTime
- Specified by:
getCreationTimein interfacede.jvstvshd.necrify.api.punishment.Punishment
-
getPredecessor
@Nullable public @Nullable de.jvstvshd.necrify.api.punishment.Punishment getPredecessor()- Specified by:
getPredecessorin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
hasBeenCreated
public boolean hasBeenCreated()- Specified by:
hasBeenCreatedin interfacede.jvstvshd.necrify.api.punishment.Punishment
-