Package org.bukkit

Interface BanEntry


public interface BanEntry
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 information
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.

  • Method Summary

    Modifier and Type Method Description
    java.util.Date getCreated()
    Gets the date this ban entry was created.
    java.util.Date getExpiration()
    Gets the date this ban expires on, or null for no defined end date.
    java.lang.String getReason()
    Gets the reason for this ban.
    java.lang.String getSource()
    Gets the source of this ban.
    java.lang.String getTarget()
    Gets the target involved.
    void save()
    Saves the ban entry, overwriting any previous data in the ban list.
    void setCreated​(java.util.Date created)
    Sets the date this ban entry was created.
    void setExpiration​(java.util.Date expiration)
    Sets the date this ban expires on.
    void setReason​(java.lang.String reason)
    Sets the reason for this ban.
    void setSource​(java.lang.String source)
    Sets the source of this ban.
  • Method Details

    • getTarget

      java.lang.String getTarget()
      Gets the target involved. This may be in the form of an IP or a player name.
      Returns:
      the target name or IP address
    • getCreated

      java.util.Date getCreated()
      Gets the date this ban entry was created.
      Returns:
      the creation date
    • setCreated

      void setCreated​(java.util.Date created)
      Sets the date this ban entry was created.
      Parameters:
      created - the new created date, cannot be null
      See Also:
      saving changes
    • getSource

      java.lang.String getSource()
      Gets the source of this ban.

      Note: A source is considered any String, although this is generally a player name.

      Returns:
      the source of the ban
    • setSource

      void setSource​(java.lang.String source)
      Sets the source of this ban.

      Note: A source is considered any String, although this is generally a player name.

      Parameters:
      source - the new source where null values become empty strings
      See Also:
      saving changes
    • getExpiration

      java.util.Date getExpiration()
      Gets the date this ban expires on, or null for no defined end date.
      Returns:
      the expiration date
    • setExpiration

      void setExpiration​(java.util.Date expiration)
      Sets the date this ban expires on. Null values are considered "infinite" bans.
      Parameters:
      expiration - the new expiration date, or null to indicate an eternity
      See Also:
      saving changes
    • getReason

      java.lang.String getReason()
      Gets the reason for this ban.
      Returns:
      the ban reason, or null if not set
    • setReason

      void setReason​(java.lang.String reason)
      Sets the reason for this ban. Reasons must not be null.
      Parameters:
      reason - the new reason, null values assume the implementation default
      See Also:
      saving changes
    • 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.