Interface BanEntry<T>
- Type Parameters:
T- The ban target
public interface BanEntry<T>
A single entry from a ban list. This may represent either a player ban or
an IP ban.
Ban entries include the following properties:
| Property | Description |
|---|---|
| Target Profile / IP Address | The target profile or IP address |
| Creation Date | The creation date of the ban |
| Source | The source of the ban, such as a player, console, plugin, etc |
| Expiration Date | The expiration date of the ban |
| Reason | The reason for the ban |
Unsaved information is not automatically written to the implementation's
ban list, instead, the save() method must be called to write the
changes to the ban list. If this ban entry has expired (such as from an
unban) and is no longer found in the list, the save() call will
re-add it to the list, therefore banning the victim specified.
Likewise, changes to the associated BanList or other entries may or
may not be reflected in this entry.
-
Method Summary
Modifier and TypeMethodDescriptionGets the target involved.Gets the date this ban entry was created.Gets the date this ban expires on, or null for no defined end date.Gets the reason for this ban.Gets the source of this ban.Deprecated.voidremove()Removes this ban entry from the appropriate ban list.voidsave()Saves the ban entry, overwriting any previous data in the ban list.voidsetCreated(@NotNull Date created) Sets the date this ban entry was created.voidsetExpiration(@Nullable Date expiration) Sets the date this ban expires on.voidSets the reason for this ban.voidSets the source of this ban.
-
Method Details
-
getTarget
Deprecated.SeegetBanTarget()Gets the target involved. This may be in the form of an IP or a player name.- Returns:
- the target name or IP address
-
getBanTarget
-
getCreated
-
setCreated
-
getSource
-
setSource
-
getExpiration
-
setExpiration
-
getReason
-
setReason
-
save
void save()Saves the ban entry, overwriting any previous data in the ban list.Saving the ban entry of an unbanned player will cause the player to be banned once again.
-
remove
void remove()Removes this ban entry from the appropriate ban list.
-
getBanTarget()