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
-
Field Summary
Fields inherited from class de.jvstvshd.necrify.common.punishment.AbstractPunishment
APPLY_CANCELLATION, APPLY_CHANGE, APPLY_PUNISHMENT, APPLY_SUCCESSOR, APPLY_TIMESTAMP_UPDATE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTemporalPunishment(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 Summary
Modifier and TypeMethodDescriptionprotected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> protected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> final @NotNull CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> change(@NotNull de.jvstvshd.necrify.api.duration.PunishmentDuration newDuration, @Nullable LocalDateTime creationTime, net.kyori.adventure.text.Component newReason) protected void@NotNull de.jvstvshd.necrify.api.duration.PunishmentDurationabstract @NotNull de.jvstvshd.necrify.api.punishment.StandardPunishmentTypegetType()booleanbooleanisValid()@NotNull CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> setSuccessor(@NotNull de.jvstvshd.necrify.api.punishment.Punishment successor) toString()@NotNull de.jvstvshd.necrify.api.duration.PunishmentDurationMethods inherited from class de.jvstvshd.necrify.common.punishment.AbstractPunishment
cancel, convertReason, equals, executeAsync, getCreationTime, getEventDispatcher, getExecutor, getMessageProvider, getPlugin, getPredecessor, getPunishmentUuid, getReason, getSuccessor, getUser, getUuid, hasBeenCreated, hashCode, hasSuccessor, punishMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.jvstvshd.necrify.api.punishment.Punishment
cancel, getCreationTime, getPredecessor, getPunishmentUuid, getSuccessor, getSuccessorOrNull, getUser, getUuid, hasBeenCreated, hasSuccessor, punishMethods inherited from interface de.jvstvshd.necrify.api.punishment.util.ReasonHolder
createFullReason, getReasonMethods inherited from interface de.jvstvshd.necrify.api.punishment.TemporalPunishment
change, isPermanent
-
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:
getDurationin interfacede.jvstvshd.necrify.api.punishment.TemporalPunishment
-
isOngoing
public boolean isOngoing()- Specified by:
isOngoingin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
toString
- Overrides:
toStringin classAbstractPunishment
-
isValid
public boolean isValid()- Overrides:
isValidin classAbstractPunishment
-
checkValidity
protected void checkValidity()- Overrides:
checkValidityin classAbstractPunishment
-
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:
changein interfacede.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:
applyCancellationin classAbstractPunishment- Throws:
de.jvstvshd.necrify.api.PunishmentException
-
getType
@NotNull public abstract @NotNull de.jvstvshd.necrify.api.punishment.StandardPunishmentType getType()- Specified by:
getTypein interfacede.jvstvshd.necrify.api.punishment.Punishment
-
applyPunishment
protected CompletableFuture<de.jvstvshd.necrify.api.punishment.Punishment> applyPunishment() throws de.jvstvshd.necrify.api.PunishmentException- Specified by:
applyPunishmentin classAbstractPunishment- 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:
setSuccessorin interfacede.jvstvshd.necrify.api.punishment.Punishment
-
totalDuration
@NotNull public @NotNull de.jvstvshd.necrify.api.duration.PunishmentDuration totalDuration()- Specified by:
totalDurationin interfacede.jvstvshd.necrify.api.punishment.TemporalPunishment
-