public interface BanBuilder
Modifier and Type | Method and Description |
---|---|
BanBuilder |
address(InetAddress address)
Sets the IP address to be banned.
|
Ban |
build()
Creates a new Ban from this builder.
|
BanBuilder |
expirationDate(Date date)
Sets the expiration date of the ban, or removes it.
|
BanBuilder |
reason(Text.Literal reason)
Sets the reason for the ban.
|
BanBuilder |
source(CommandSource source)
Sets the source of the ban, or removes it if
null is passed in. |
BanBuilder |
startDate(Date date)
Sets the date that the ban starts.
|
BanBuilder |
type(BanType type)
Sets the type of the ban.
|
BanBuilder |
user(User user)
Sets the user to be banned.
|
BanBuilder user(User user)
This can only be done if the BanType
has been set to BanType.USER_BAN
.
user
- The userBanBuilder address(InetAddress address)
This can only be done if the BanType
has been set to BanType.IP_BAN
.
address
- The IP addressBanBuilder type(BanType type)
type
- The type to be setBanBuilder reason(Text.Literal reason)
reason
- The reasonBanBuilder startDate(Date date)
date
- The start dateBanBuilder expirationDate(@Nullable Date date)
date
- The expiration date, or null in order to remove itBanBuilder source(@Nullable CommandSource source)
null
is passed in.source
- The source of the ban, or null
Ban build()