public interface BanEntry
Ban entries include the following properties:
Property | Description |
---|---|
Target Name / IP Address | The target name 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.
Modifier and Type | Method and Description |
---|---|
@NotNull Date |
getCreated()
Gets the date this ban entry was created.
|
@Nullable Date |
getExpiration()
Gets the date this ban expires on, or null for no defined end date.
|
@Nullable String |
getReason()
Gets the reason for this ban.
|
@NotNull String |
getSource()
Gets the source of this ban.
|
@NotNull String |
getTarget()
Gets the target involved.
|
void |
save()
Saves the ban entry, overwriting any previous data in the ban list.
|
void |
setCreated(@NotNull Date created)
Sets the date this ban entry was created.
|
void |
setExpiration(@Nullable Date expiration)
Sets the date this ban expires on.
|
void |
setReason(@Nullable String reason)
Sets the reason for this ban.
|
void |
setSource(@NotNull String source)
Sets the source of this ban.
|
@NotNull @NotNull String getTarget()
@NotNull @NotNull Date getCreated()
void setCreated(@NotNull @NotNull Date created)
created
- the new created date, cannot be nullsaving changes
@NotNull @NotNull String getSource()
Note: A source is considered any String, although this is generally a player name.
void setSource(@NotNull @NotNull String source)
Note: A source is considered any String, although this is generally a player name.
source
- the new source where null values become empty stringssaving changes
@Nullable @Nullable Date getExpiration()
void setExpiration(@Nullable @Nullable Date expiration)
expiration
- the new expiration date, or null to indicate an
eternitysaving changes
@Nullable @Nullable String getReason()
void setReason(@Nullable @Nullable String reason)
reason
- the new reason, null values assume the implementation
defaultsaving changes
void save()
Saving the ban entry of an unbanned player will cause the player to be banned once again.
Copyright © 2021. All rights reserved.