Record Class BanEntry.Profile
java.lang.Object
java.lang.Record
fr.fidorial.moderation.BanEntry.Profile
- Record Components:
uuid- the banned identityname- the last known name of the player, ornullreason- why the player 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 TypeMethodDescriptioncreated()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.Profilelasting(UUID uuid, @Nullable String name, @Nullable Component reason, @Nullable UUID source, Duration duration) Creates a ban on an identity lasting the given amount of time, counted from now.name()Returns the value of thenamerecord component.static BanEntry.ProfileCreates a ban on an identity 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.Profileuntil(UUID uuid, @Nullable String name, @Nullable Component reason, @Nullable UUID source, @Nullable Instant expires) Creates a ban on an identity lifting at the given instant.uuid()Returns the value of theuuidrecord component.Methods inherited from interface BanEntry
createdLabel, describeReason, expired, expiresLabel, permanent, remaining
-
Constructor Details
-
Profile
public Profile(UUID uuid, @Nullable String name, @Nullable Component reason, @Nullable UUID source, Instant created, @Nullable Instant expires) Creates an instance of aProfilerecord class.- Parameters:
uuid- the value for theuuidrecord 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.Profile permanent(UUID uuid, @Nullable String name, @Nullable Component reason, @Nullable UUID source) Creates a ban on an identity that never lifts.- Parameters:
uuid- the identity to banname- the name to record for display, ornullreason- why the player is banned, ornullsource- the identity of who is issuing the ban, ornullfor the server- Returns:
- the ban
- Since:
- 0.1.0
-
lasting
@Contract(pure=true) public static BanEntry.Profile lasting(UUID uuid, @Nullable String name, @Nullable Component reason, @Nullable UUID source, Duration duration) Creates a ban on an identity lasting the given amount of time, counted from now.- Parameters:
uuid- the identity to banname- the name to record for display, ornullreason- why the player 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.Profile until(UUID uuid, @Nullable String name, @Nullable Component reason, @Nullable UUID source, @Nullable Instant expires) Creates a ban on an identity lifting at the given instant.- Parameters:
uuid- the identity to banname- the name to record for display, ornullreason- why the player is banned, ornullsource- who is issuing the banexpires- when the ban lifts, ornullfor a permanent ban- Returns:
- the ban
- Since:
- 0.1.0
-
label
-
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). -
uuid
-
name
-
reason
-
source
-
created
-
expires
-