Interface BanEntry
- All Known Implementing Classes:
BanEntry.Address, BanEntry.Profile
Represents a ban.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA ban on a client address.static final recordA ban on a player identity. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreated()Gets when the ban was issued.default StringGets when the ban was issued, as a readable date.Gets why the target is banned.default booleanexpired()Checks whether the expiry has already passed.expires()Gets when the ban lifts.default StringGets when the ban lifts, as a readable date.label()Gets the label for what the ban applies to.name()Gets the name recorded for display, which is the last known name of the player the ban was issued against.default booleanChecks whether this ban never lifts on its own.reason()Gets why the target is banned.Gets how long is left before the ban lifts.source()Gets who issued the ban.
-
Field Details
-
FORMAT
-
-
Method Details
-
name
-
reason
-
source
Gets who issued the ban.This is an identity rather than a name, so an issuer who later changes name is still the same issuer. A ban the server itself issued has no identity to record.
- Returns:
- the identity of the issuer, or
nullwhen the server issued the ban - Since:
- 0.1.0
-
created
Gets when the ban was issued.- Returns:
- the creation timestamp
- Since:
- 0.1.0
-
expires
-
label
Gets the label for what the ban applies to.- Returns:
- the text identifying the target in messages
- Since:
- 0.1.0
-
permanent
@Contract(pure=true) default boolean permanent()Checks whether this ban never lifts on its own.- Returns:
truewhen the ban has no expiry- Since:
- 0.1.0
-
expired
@Contract(pure=true) default boolean expired()Checks whether the expiry has already passed.An expired entry is not an active ban. A
BanManageris expected to stop reporting it, and may discard it.- Returns:
truewhen the ban has run out- Since:
- 0.1.0
-
remaining
Gets how long is left before the ban lifts.- Returns:
- the remaining time, or empty for a permanent ban;
Duration.ZEROonce the expiry has passed - Since:
- 0.1.0
-
describeReason
-
createdLabel
Gets when the ban was issued, as a readable date.- Returns:
- the creation date
- Since:
- 0.1.0
-
expiresLabel
Gets when the ban lifts, as a readable date.- Returns:
- the expiry date, or an empty string for a permanent ban
- Since:
- 0.1.0
-