Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
BanEntry.java
1 package org.bukkit;
2 
3 import java.util.Date;
4 
5 /**
6  * A single entry from a ban list. This may represent either a player ban or
7  * an IP ban.
8  * <p>
9  * Ban entries include the following properties:
10  * <table border=1>
11  * <tr>
12  * <th>Property</th>
13  * <th>Description</th>
14  * </tr><tr>
15  * <td>Target Name / IP Address</td>
16  * <td>The target name or IP address</td>
17  * </tr><tr>
18  * <td>Creation Date</td>
19  * <td>The creation date of the ban</td>
20  * </tr><tr>
21  * <td>Source</td>
22  * <td>The source of the ban, such as a player, console, plugin, etc</td>
23  * </tr><tr>
24  * <td>Expiration Date</td>
25  * <td>The expiration date of the ban</td>
26  * </tr><tr>
27  * <td>Reason</td>
28  * <td>The reason for the ban</td>
29  * </tr>
30  * </table>
31  * <p>
32  * Unsaved information is not automatically written to the implementation's
33  * ban list, instead, the {@link #save()} method must be called to write the
34  * changes to the ban list. If this ban entry has expired (such as from an
35  * unban) and is no longer found in the list, the {@link #save()} call will
36  * re-add it to the list, therefore banning the victim specified.
37  * <p>
38  * Likewise, changes to the associated {@link BanList} or other entries may or
39  * may not be reflected in this entry.
40  */
41 public interface BanEntry {
42 
43  /**
44  * Gets the target involved. This may be in the form of an IP or a player
45  * name.
46  *
47  * @return the target name or IP address
48  */
49  public String getTarget();
50 
51  /**
52  * Gets the date this ban entry was created.
53  *
54  * @return the creation date
55  */
56  public Date getCreated();
57 
58  /**
59  * Sets the date this ban entry was created.
60  *
61  * @param created the new created date, cannot be null
62  * @see #save() saving changes
63  */
64  public void setCreated(Date created);
65 
66  /**
67  * Gets the source of this ban.
68  * <p>
69  * Note: A source is considered any String, although this is generally a
70  * player name.
71  *
72  * @return the source of the ban
73  */
74  public String getSource();
75 
76  /**
77  * Sets the source of this ban.
78  * <p>
79  * Note: A source is considered any String, although this is generally a
80  * player name.
81  *
82  * @param source the new source where null values become empty strings
83  * @see #save() saving changes
84  */
85  public void setSource(String source);
86 
87  /**
88  * Gets the date this ban expires on, or null for no defined end date.
89  *
90  * @return the expiration date
91  */
92  public Date getExpiration();
93 
94  /**
95  * Sets the date this ban expires on. Null values are considered
96  * "infinite" bans.
97  *
98  * @param expiration the new expiration date, or null to indicate an
99  * eternity
100  * @see #save() saving changes
101  */
102  public void setExpiration(Date expiration);
103 
104  /**
105  * Gets the reason for this ban.
106  *
107  * @return the ban reason, or null if not set
108  */
109  public String getReason();
110 
111  /**
112  * Sets the reason for this ban. Reasons must not be null.
113  *
114  * @param reason the new reason, null values assume the implementation
115  * default
116  * @see #save() saving changes
117  */
118  public void setReason(String reason);
119 
120  /**
121  * Saves the ban entry, overwriting any previous data in the ban list.
122  * <p>
123  * Saving the ban entry of an unbanned player will cause the player to be
124  * banned once again.
125  */
126  public void save();
127 }
Date getExpiration()
void setExpiration(Date expiration)
void setReason(String reason)
String getTarget()
Date getCreated()
String getReason()
Definition: BanEntry.java:41
void setCreated(Date created)
void setSource(String source)
String getSource()
void save()