Record Class FinishedSession
java.lang.Object
java.lang.Record
com.djrapitops.plan.gathering.domain.FinishedSession
- All Implemented Interfaces:
DateHolder
public record FinishedSession(UUID playerUUID, ServerUUID serverUUID, long start, long end, long afkTime, DataMap extraData)
extends Record
implements DateHolder
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFinishedSession(UUID playerUUID, ServerUUID serverUUID, long start, long end, long afkTime, DataMap extraData) Creates an instance of aFinishedSessionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongafkTime()Returns the value of theafkTimerecord component.longdate()Get the date the object holds.static Optional<FinishedSession> deserializeCSV(String serialized) Deserialize csv format of the session.longend()Returns the value of theendrecord component.booleanIndicates whether some other object is "equal to" this one.Returns the value of theextraDatarecord component.longint<T> Optional<T> getExtraData(Class<T> ofType) longintintfinal inthashCode()Returns a hash code value for this object.booleanReturns the value of theplayerUUIDrecord component.Serialize into csv format.Returns the value of theserverUUIDrecord component.voidsetAsFirstSessionIfMatches(Long registerDate) longstart()Returns the value of thestartrecord component.@NonNull StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FinishedSession
public FinishedSession(UUID playerUUID, ServerUUID serverUUID, long start, long end, long afkTime, DataMap extraData) Creates an instance of aFinishedSessionrecord class.- Parameters:
playerUUID- the value for theplayerUUIDrecord componentserverUUID- the value for theserverUUIDrecord componentstart- the value for thestartrecord componentend- the value for theendrecord componentafkTime- the value for theafkTimerecord componentextraData- the value for theextraDatarecord component
-
-
Method Details
-
deserializeCSV
Deserialize csv format of the session.- Parameters:
serialized- Serialized version of the session- Returns:
- Proper session if the csv had 9 columns or more
- Throws:
com.google.gson.JsonSyntaxException- if serialized format has a json syntax error
-
getLength
public long getLength() -
getActiveTime
public long getActiveTime() -
getMobKillCount
public int getMobKillCount() -
getDeathCount
public int getDeathCount() -
getPlayerKillCount
public int getPlayerKillCount() -
setAsFirstSessionIfMatches
-
isFirstSession
public boolean isFirstSession() -
getExtraData
-
date
public long date()Description copied from interface:DateHolderGet the date the object holds.- Specified by:
datein interfaceDateHolder- Returns:
- Epoch ms - milliseconds passed since January 1st 1970.
-
toString
-
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. -
serializeCSV
-
hashCode
-
playerUUID
Returns the value of theplayerUUIDrecord component.- Returns:
- the value of the
playerUUIDrecord component
-
serverUUID
Returns the value of theserverUUIDrecord component.- Returns:
- the value of the
serverUUIDrecord component
-
start
public long start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
public long end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
afkTime
public long afkTime()Returns the value of theafkTimerecord component.- Returns:
- the value of the
afkTimerecord component
-
extraData
Returns the value of theextraDatarecord component.- Returns:
- the value of the
extraDatarecord component
-