Interface Ban.Builder
-
- All Superinterfaces:
AbstractBuilder<Ban>
,Buildable.Builder<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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Ban.Builder
address(java.net.InetAddress address)
Sets the IP address to be banned.Ban
build()
Creates a new Ban from this builder.Ban.Builder
expirationDate(@Nullable java.time.Instant instant)
Sets the expiration date of the ban, or removes it.Ban.Builder
profile(GameProfile profile)
Sets the profile to be banned.Ban.Builder
reason(@Nullable Component reason)
Sets the reason for the ban.Ban.Builder
source(@Nullable Component source)
Sets the source of the ban as aComponent
, or removes it ifnull
is passed in.Ban.Builder
startDate(java.time.Instant instant)
Sets the date that the ban starts.default Ban.Builder
type(java.util.function.Supplier<? extends BanType> type)
Sets the type of the ban.Ban.Builder
type(BanType type)
Sets the type of the ban.-
Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
-
-
-
Method Detail
-
profile
Ban.Builder profile(GameProfile 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
Ban.Builder address(java.net.InetAddress 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
Ban.Builder type(BanType type)
Sets the type of the ban.- Parameters:
type
- The type to be set- Returns:
- This builder
-
type
default Ban.Builder type(java.util.function.Supplier<? extends BanType> type)
Sets the type of the ban.- Parameters:
type
- The type to be set- Returns:
- This builder
-
reason
Ban.Builder reason(@Nullable Component 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
Ban.Builder startDate(java.time.Instant instant)
Sets the date that the ban starts.- Parameters:
instant
- The start date- Returns:
- This builder
-
expirationDate
Ban.Builder expirationDate(@Nullable java.time.Instant instant)
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
Ban.Builder source(@Nullable Component 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>
- Specified by:
build
in interfaceBuildable.Builder<Ban>
- Returns:
- A new Ban
-
-