Record Class PlayerKill
java.lang.Object
java.lang.Record
com.djrapitops.plan.gathering.domain.PlayerKill
- All Implemented Interfaces:
DateHolder
public record PlayerKill(PlayerKill.Killer killer, PlayerKill.Victim victim, String weapon, long date, ServerIdentifier server)
extends Record
implements DateHolder
Represents a player vs player kill.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPlayerKill(PlayerKill.Killer killer, PlayerKill.Victim victim, ServerIdentifier server, String weapon, long date) PlayerKill(PlayerKill.Killer killer, PlayerKill.Victim victim, String weapon, long date, ServerIdentifier server) Creates an instance of aPlayerKillrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongdate()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanbooleankiller()Returns the value of thekillerrecord component.server()Returns the value of theserverrecord component.toJson()toString()Returns a string representation of this record class.victim()Returns the value of thevictimrecord component.weapon()Get the Weapon used as string.
-
Constructor Details
-
PlayerKill
public PlayerKill(PlayerKill.Killer killer, PlayerKill.Victim victim, ServerIdentifier server, String weapon, long date) -
PlayerKill
public PlayerKill(PlayerKill.Killer killer, PlayerKill.Victim victim, String weapon, long date, ServerIdentifier server) Creates an instance of aPlayerKillrecord class.- Parameters:
killer- the value for thekillerrecord componentvictim- the value for thevictimrecord componentweapon- the value for theweaponrecord componentdate- the value for thedaterecord componentserver- the value for theserverrecord component
-
-
Method Details
-
weapon
-
toString
-
isSelfKill
public boolean isSelfKill() -
isNotSelfKill
public boolean isNotSelfKill() -
toJson
-
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. -
killer
Returns the value of thekillerrecord component.- Returns:
- the value of the
killerrecord component
-
victim
Returns the value of thevictimrecord component.- Returns:
- the value of the
victimrecord component
-
date
public long date()Returns the value of thedaterecord component.- Specified by:
datein interfaceDateHolder- Returns:
- the value of the
daterecord component
-
server
Returns the value of theserverrecord component.- Returns:
- the value of the
serverrecord component
-