Package org.bukkit
Interface BanList<T>
- Type Parameters:
T
- The ban target
- All Known Subinterfaces:
IpBanList
,ProfileBanList
public interface BanList<T>
A ban list, containing bans of some
BanList.Type
.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddBan
(@NotNull String target, @Nullable String reason, @Nullable Date expires, @Nullable String source) Deprecated.Adds a ban to this list.Adds a ban to this list.Adds a ban to this list.Deprecated.This return a generic class, prefer usegetEntries()
getBanEntry
(@NotNull String target) Deprecated.getBanEntry
(T target) Gets aBanEntry
by target.Gets a set containing everyBanEntry
in this list.boolean
Deprecated.seeisBanned(Object)
boolean
Gets if aBanEntry
exists for the target, indicating an active ban status.void
Deprecated.seepardon(Object)
void
Removes the specified target from this list, therefore indicating a "not banned" status.
-
Method Details
-
getBanEntry
@Deprecated(since="1.20.1") @Nullable <E extends BanEntry<? super T>> E getBanEntry(@NotNull @NotNull String target) Deprecated.Gets aBanEntry
by target.Bans by name for ban type
NAME
are no longer supported and this method will return null when trying to request them. The replacement is bans by UUID.- Parameters:
target
- entry parameter to search for- Returns:
- the corresponding entry, or null if none found
-
getBanEntry
Gets aBanEntry
by target.- Parameters:
target
- entry parameter to search for- Returns:
- the corresponding entry, or null if none found
-
addBan
@Deprecated(since="1.20.1") @Nullable <E extends BanEntry<? super T>> E addBan(@NotNull @NotNull String target, @Nullable @Nullable String reason, @Nullable @Nullable Date expires, @Nullable @Nullable String source) Deprecated.Adds a ban to this list. If a previous ban exists, this will update the previous entry.Bans by name for ban type
NAME
are no longer supported and this method will return null when trying to request them. The replacement is bans by UUID.- Parameters:
target
- the target of the banreason
- reason for the ban, null indicates implementation defaultexpires
- date for the ban's expiration (unban), or null to imply foreversource
- source of the ban, null indicates implementation default- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
-
addBan
@Nullable @Nullable BanEntry<T> addBan(@NotNull T target, @Nullable @Nullable String reason, @Nullable @Nullable Date expires, @Nullable @Nullable String source) Adds a ban to this list. If a previous ban exists, this will update the previous entry.- Parameters:
target
- the target of the banreason
- reason for the ban, null indicates implementation defaultexpires
- date for the ban's expiration (unban), or null to imply foreversource
- source of the ban, null indicates implementation default- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
-
addBan
@Nullable @Nullable BanEntry<T> addBan(@NotNull T target, @Nullable @Nullable String reason, @Nullable @Nullable Instant expires, @Nullable @Nullable String source) Adds a ban to this list. If a previous ban exists, this will update the previous entry.- Parameters:
target
- the target of the banreason
- reason for the ban, null indicates implementation defaultexpires
- instant for the ban's expiration (unban), or null to imply foreversource
- source of the ban, null indicates implementation default- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
-
addBan
@Nullable @Nullable BanEntry<T> addBan(@NotNull T target, @Nullable @Nullable String reason, @Nullable @Nullable Duration duration, @Nullable @Nullable String source) Adds a ban to this list. If a previous ban exists, this will update the previous entry.- Parameters:
target
- the target of the banreason
- reason for the ban, null indicates implementation defaultduration
- the duration of the ban, or null to imply foreversource
- source of the ban, null indicates implementation default- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
-
getBanEntries
Deprecated.This return a generic class, prefer usegetEntries()
Gets a set containing everyBanEntry
in this list.- Returns:
- an immutable set containing every entry tracked by this list
-
getEntries
Gets a set containing everyBanEntry
in this list.- Returns:
- an immutable set containing every entry tracked by this list
-
isBanned
Gets if aBanEntry
exists for the target, indicating an active ban status.Bans by name for ban type
NAME
are no longer supported. The replacement is bans by UUID.- Parameters:
target
- the target to find- Returns:
- true if a
BanEntry
exists for the target, indicating an active ban status, false otherwise
-
isBanned
Deprecated.seeisBanned(Object)
Gets if aBanEntry
exists for the target, indicating an active ban status.- Parameters:
target
- the target to find- Returns:
- true if a
BanEntry
exists for the target, indicating an active ban status, false otherwise
-
pardon
Removes the specified target from this list, therefore indicating a "not banned" status.Bans by name for ban type
NAME
are no longer supported. The replacement is bans by UUID.- Parameters:
target
- the target to remove from this list
-
pardon
Deprecated.seepardon(Object)
Removes the specified target from this list, therefore indicating a "not banned" status.- Parameters:
target
- the target to remove from this list
-
BanListType
to enforce the correct return value at compile time.