Record Class Moderation
java.lang.Object
java.lang.Record
net.flectone.pulse.model.util.Moderation
public record Moderation(int id, int player, long date, long time, String reason, int moderator, Moderation.Type type, boolean valid, String server)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionModeration(int id, int player, long date, long time, String reason, int moderator, String typeName, boolean valid, String server) Moderation(int id, int player, long date, long time, String reason, int moderator, Moderation.Type type, boolean valid, String server) Creates an instance of aModerationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongdate()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.booleanequals(Moderation moderation) longlongfinal inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.booleanisActive()booleanbooleanintReturns the value of themoderatorrecord component.intplayer()Returns the value of theplayerrecord component.reason()Returns the value of thereasonrecord component.server()Returns the value of theserverrecord component.longtime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.booleanvalid()Returns the value of thevalidrecord component.withDate(long date) withId(int id) withModerator(int moderator) withPlayer(int player) withReason(String reason) withServer(String server) withTime(long time) withType(Moderation.Type type) withValid(boolean valid)
-
Field Details
-
PERMANENT_TIME
public static final int PERMANENT_TIME- See Also:
-
-
Constructor Details
-
Moderation
-
Moderation
public Moderation(int id, int player, long date, long time, String reason, int moderator, Moderation.Type type, boolean valid, String server) Creates an instance of aModerationrecord class.- Parameters:
id- the value for theidrecord componentplayer- the value for theplayerrecord componentdate- the value for thedaterecord componenttime- the value for thetimerecord componentreason- the value for thereasonrecord componentmoderator- the value for themoderatorrecord componenttype- the value for thetyperecord componentvalid- the value for thevalidrecord componentserver- the value for theserverrecord component
-
-
Method Details
-
isActive
public boolean isActive() -
isPermanent
public boolean isPermanent() -
isExpired
public boolean isExpired() -
getRemainingTime
public long getRemainingTime() -
getOriginalTime
public long getOriginalTime() -
equals
-
withId
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withPlayer
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withDate
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withTime
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withReason
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withModerator
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withType
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withValid
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withServer
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
player
public int player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
date
public long date()Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
time
public long time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
moderator
public int moderator()Returns the value of themoderatorrecord component.- Returns:
- the value of the
moderatorrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
valid
public boolean valid()Returns the value of thevalidrecord component.- Returns:
- the value of the
validrecord component
-
server
Returns the value of theserverrecord component.- Returns:
- the value of the
serverrecord component
-