Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
BanList.java
1 package org.bukkit;
2 
3 import java.util.Date;
4 import java.util.Set;
5 
6 /**
7  * A ban list, containing bans of some {@link Type}.
8  */
9 public interface BanList {
10 
11  /**
12  * Represents a ban-type that a {@link BanList} may track.
13  */
14  public enum Type {
15  /**
16  * Banned player names
17  */
19  /**
20  * Banned player IP addresses
21  */
22  IP,
23  ;
24  }
25 
26  /**
27  * Gets a {@link BanEntry} by target.
28  *
29  * @param target entry parameter to search for
30  * @return the corresponding entry, or null if none found
31  */
32  public BanEntry getBanEntry(String target);
33 
34  /**
35  * Adds a ban to the this list. If a previous ban exists, this will
36  * update the previous entry.
37  *
38  * @param target the target of the ban
39  * @param reason reason for the ban, null indicates implementation default
40  * @param expires date for the ban's expiration (unban), or null to imply
41  * forever
42  * @param source source of the ban, null indicates implementation default
43  * @return the entry for the newly created ban, or the entry for the
44  * (updated) previous ban
45  */
46  public BanEntry addBan(String target, String reason, Date expires, String source);
47 
48  /**
49  * Gets a set containing every {@link BanEntry} in this list.
50  *
51  * @return an immutable set containing every entry tracked by this list
52  */
53  public Set<BanEntry> getBanEntries();
54 
55  /**
56  * Gets if a {@link BanEntry} exists for the target, indicating an active
57  * ban status.
58  *
59  * @param target the target to find
60  * @return true if a {@link BanEntry} exists for the name, indicating an
61  * active ban status, false otherwise
62  */
63  public boolean isBanned(String target);
64 
65  /**
66  * Removes the specified target from this list, therefore indicating a
67  * "not banned" status.
68  *
69  * @param target the target to remove from this list
70  */
71  public void pardon(String target);
72 }
void pardon(String target)
boolean isBanned(String target)
Definition: BanEntry.java:41
BanEntry getBanEntry(String target)
BanEntry addBan(String target, String reason, Date expires, String source)
Set< BanEntry > getBanEntries()