Class FinishedSession
- java.lang.Object
-
- com.djrapitops.plan.gathering.domain.FinishedSession
-
- All Implemented Interfaces:
DateHolder
public class FinishedSession extends java.lang.Object implements DateHolder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FinishedSession.Id
-
Constructor Summary
Constructors Constructor Description FinishedSession(java.util.UUID playerUUID, ServerUUID serverUUID, long start, long end, long afkTime, DataMap extraData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<FinishedSession>
deserializeCSV(java.lang.String serialized)
Deserialize csv format of the session.boolean
equals(java.lang.Object o)
long
getActiveTime()
long
getAfkTime()
long
getDate()
Get the date the object holds.int
getDeathCount()
long
getEnd()
DataMap
getExtraData()
<T> java.util.Optional<T>
getExtraData(java.lang.Class<T> ofType)
long
getLength()
int
getMobKillCount()
int
getPlayerKillCount()
java.util.UUID
getPlayerUUID()
ServerUUID
getServerUUID()
long
getStart()
int
hashCode()
boolean
isFirstSession()
java.lang.String
serializeCSV()
Serialize into csv format.void
setAsFirstSessionIfMatches(java.lang.Long registerDate)
java.lang.String
toString()
-
-
-
Constructor Detail
-
FinishedSession
public FinishedSession(java.util.UUID playerUUID, ServerUUID serverUUID, long start, long end, long afkTime, DataMap extraData)
-
-
Method Detail
-
getPlayerUUID
public java.util.UUID getPlayerUUID()
-
getServerUUID
public ServerUUID getServerUUID()
-
getStart
public long getStart()
-
getEnd
public long getEnd()
-
getAfkTime
public long getAfkTime()
-
getLength
public long getLength()
-
getActiveTime
public long getActiveTime()
-
getMobKillCount
public int getMobKillCount()
-
getDeathCount
public int getDeathCount()
-
getPlayerKillCount
public int getPlayerKillCount()
-
setAsFirstSessionIfMatches
public void setAsFirstSessionIfMatches(java.lang.Long registerDate)
-
isFirstSession
public boolean isFirstSession()
-
getExtraData
public DataMap getExtraData()
-
getExtraData
public <T> java.util.Optional<T> getExtraData(java.lang.Class<T> ofType)
-
getDate
public long getDate()
Description copied from interface:DateHolder
Get the date the object holds.- Specified by:
getDate
in interfaceDateHolder
- Returns:
- Epoch ms - milliseconds passed since January 1st 1970.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
deserializeCSV
public static java.util.Optional<FinishedSession> deserializeCSV(java.lang.String serialized)
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
-
serializeCSV
public java.lang.String serializeCSV()
Serialize into csv format.- Returns:
- Serialized format
-
-