Interface Ban.Builder
- All Superinterfaces:
AbstractBuilder<Ban>
,Builder<Ban,
,Ban.Builder> CopyableBuilder<Ban,
,Ban.Builder> ResettableBuilder<Ban,
Ban.Builder>
- Enclosing interface:
Ban
public static interface Ban.Builder
extends Builder<Ban,Ban.Builder>, CopyableBuilder<Ban,Ban.Builder>
Represents a builder that creates bans.
-
Method Summary
Modifier and TypeMethodDescriptionaddress
(InetAddress address) Sets the IP address to be banned.build()
Creates a new Ban from this builder.expirationDate
(@Nullable Instant instant) Sets the expiration date of the ban, or removes it.profile
(GameProfile profile) Sets the profile to be banned.Sets the reason for the ban.Sets the source of the ban as aComponent
, or removes it ifnull
is passed in.Sets the date that the ban starts.default Ban.Builder
Sets the type of the ban.Sets the type of the ban.Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
Method Details
-
profile
Sets the profile to be banned.This can only be done if the
BanType
has been set toBanTypes.PROFILE
.- Parameters:
profile
- The profile- Returns:
- This builder
-
address
Sets the IP address to be banned.This can only be done if the
BanType
has been set toBanTypes.IP
.- Parameters:
address
- The IP address- Returns:
- This builder
-
type
Sets the type of the ban.- Parameters:
type
- The type to be set- Returns:
- This builder
-
type
Sets the type of the ban.- Parameters:
type
- The type to be set- Returns:
- This builder
-
reason
Sets the reason for the ban.If the specified reason is
null
, or not provided, then the reason will be be available on the created ban.- Parameters:
reason
- The reason- Returns:
- This builder
-
startDate
Sets the date that the ban starts.- Parameters:
instant
- The start date- Returns:
- This builder
-
expirationDate
Sets the expiration date of the ban, or removes it.- Parameters:
instant
- The expiration date, or null in order to remove it- Returns:
- This builder
-
source
Sets the source of the ban as aComponent
, or removes it ifnull
is passed in.- Parameters:
source
- The source of the ban, ornull
- Returns:
- This builder
-
build
Ban build()Creates a new Ban from this builder.- Specified by:
build
in interfaceAbstractBuilder<Ban>
- Returns:
- A new Ban
-