Interface TemporaryPunishmentInterface
-
- All Superinterfaces:
PunishmentInterface
- All Known Subinterfaces:
TempBanInterface,TempIPBanInterface,TempMuteInterface,WarningInterface
public interface TemporaryPunishmentInterface extends PunishmentInterface
Represents a punishment with an end time
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.LonggetEnd()Calculates and returns the end of the punishment based on the start and length valuesjava.lang.LonggetLength()Get the length of the punishment in MillisecondsbooleanhasEnded()Uses thegetEnd()method to check if the punishment has endedvoidsetLength(java.lang.Long length)Set the length of this punishment This is primarily used for warnings where the length is based on a config value-
Methods inherited from interface net.lapismc.lapisbans.api.punishments.core.PunishmentInterface
createPunishment, getAction, getActioned, getAppliedBy, getAppliedTo, getReason, getStart, getType, getUndo, isShadow, reversePunishment
-
-
-
-
Method Detail
-
getLength
java.lang.Long getLength()
Get the length of the punishment in Milliseconds- Returns:
- Returns the length of the punishment
-
setLength
void setLength(java.lang.Long length)
Set the length of this punishment This is primarily used for warnings where the length is based on a config value- Parameters:
length- The length of time that this punishment will last (in Milliseconds)
-
getEnd
java.lang.Long getEnd()
Calculates and returns the end of the punishment based on the start and length values- Returns:
- Returns the system time when the punishment should expire
-
hasEnded
boolean hasEnded()
Uses thegetEnd()method to check if the punishment has ended- Returns:
- Returns true if the punishment has ended/expired, otherwise false
-
-