Interface Ban
- 
- All Known Subinterfaces:
- Ban.IP,- Ban.Profile
 
 public interface BanRepresents a ban made on an object.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceBan.BuilderRepresents a builder that creates bans.static interfaceBan.IPRepresents a ban made on an IP.static interfaceBan.ProfileRepresents a ban made on aGameProfile.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<Component>banSource()Gets the source that created this ban, if available.static Ban.Builderbuilder()Creates a new Builder.java.time.InstantcreationDate()Gets the creation date of the ban.java.util.Optional<java.time.Instant>expirationDate()Gets the expiration date of this ban, if available.default booleanisIndefinite()Gets whether this ban is indefinitely long, e.g.static Banof(GameProfile profile)Creates an indefinite ban on a profile.static Banof(GameProfile profile, Component reason)Creates an indefinite ban with a reason on a profile.java.util.Optional<Component>reason()Gets the reason for the ban, if available.BanTypetype()Gets the type of this ban.
 
- 
- 
- 
Method Detail- 
builderstatic Ban.Builder builder() Creates a new Builder.- Returns:
- A new ban builder
 
 - 
ofstatic Ban of(GameProfile profile) Creates an indefinite ban on a profile.- Parameters:
- profile- The profile
- Returns:
- The created ban
 
 - 
ofstatic Ban of(GameProfile profile, Component reason) Creates an indefinite ban with a reason on a profile.- Parameters:
- profile- The profile
- reason- The reason
- Returns:
- The created ban
 
 - 
typeBanType type() Gets the type of this ban.- Returns:
- The ban type
 
 - 
reasonjava.util.Optional<Component> reason() Gets the reason for the ban, if available.- Returns:
- The reason specified for the ban, if available
 
 - 
creationDatejava.time.Instant creationDate() Gets the creation date of the ban.Note that this Instanthas no effect on whether or not a ban is active. Any ban returned byBanService.find(GameProfile)will be used (when checking if a player can join, for example), regardless of its creation date.- Returns:
- Creation date of the ban
 
 - 
banSourcejava.util.Optional<Component> banSource() Gets the source that created this ban, if available.- Returns:
- the source of this ban, if available
 
 - 
expirationDatejava.util.Optional<java.time.Instant> expirationDate() Gets the expiration date of this ban, if available.- Returns:
- Expiration time of the ban or Optional.empty()
 
 - 
isIndefinitedefault boolean isIndefinite() Gets whether this ban is indefinitely long, e.g. has no expiration date.- Returns:
- True if this ban has no expiration date, otherwise false
 
 
- 
 
-