Record Class BanEntry.Address
java.lang.Object
java.lang.Record
fr.fidorial.moderation.BanEntry.Address
- Record Components:
address- the banned addressname- the last known name of the player it was issued against, ornullreason- why the address is banned, ornullsource- the identity of who issued the ban, ornullfor the servercreated- when the ban was issuedexpires- when the ban lifts, ornullfor a permanent ban
- All Implemented Interfaces:
BanEntry
- Enclosing interface:
BanEntry
-
Nested Class Summary
Nested classes/interfaces inherited from interface BanEntry
BanEntry.Address, BanEntry.Profile -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.created()Returns the value of thecreatedrecord component.final booleanIndicates whether some other object is "equal to" this one.expires()Returns the value of theexpiresrecord component.final inthashCode()Returns a hash code value for this object.label()Gets the label for what the ban applies to.static BanEntry.Addresslasting(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source, Duration duration) Creates a ban on an address lasting the given amount of time, counted from now.name()Returns the value of thenamerecord component.static BanEntry.Addresspermanent(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source) Creates a ban on an address that never lifts.reason()Returns the value of thereasonrecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.static BanEntry.Addressuntil(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source, @Nullable Instant expires) Creates a ban on an address lifting at the given instant.Methods inherited from interface BanEntry
createdLabel, describeReason, expired, expiresLabel, permanent, remaining
-
Constructor Details
-
Address
public Address(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source, Instant created, @Nullable Instant expires) Creates an instance of aAddressrecord class.- Parameters:
address- the value for theaddressrecord componentname- the value for thenamerecord componentreason- the value for thereasonrecord componentsource- the value for thesourcerecord componentcreated- the value for thecreatedrecord componentexpires- the value for theexpiresrecord component
-
-
Method Details
-
permanent
@Contract(pure=true) public static BanEntry.Address permanent(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source) Creates a ban on an address that never lifts.- Parameters:
address- the address to banname- the name to record for display, ornullreason- why the address is banned, ornullsource- who is issuing the ban- Returns:
- the ban
- Since:
- 0.1.0
-
lasting
@Contract(pure=true) public static BanEntry.Address lasting(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source, Duration duration) Creates a ban on an address lasting the given amount of time, counted from now.- Parameters:
address- the address to banname- the name to record for display, ornullreason- why the address is banned, ornullsource- who is issuing the banduration- how long the ban lasts- Returns:
- the ban
- Since:
- 0.1.0
-
until
@Contract(pure=true) public static BanEntry.Address until(InetAddress address, @Nullable String name, @Nullable Component reason, @Nullable UUID source, @Nullable Instant expires) Creates a ban on an address lifting at the given instant.- Parameters:
address- the address to banname- the name to record for display, ornullreason- why the address is banned, ornullsource- who is issuing the banexpires- when the ban lifts, ornullfor a permanent ban- Returns:
- the ban
- Since:
- 0.1.0
-
label
Gets the label for what the ban applies to.The address is what is banned, so it is what messages show. The recorded name is only a note about who the ban was issued against, and several players can sit behind one address.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
address
-
name
-
reason
-
source
-
created
-
expires
-