Class FinishedSession

java.lang.Object
com.djrapitops.plan.gathering.domain.FinishedSession
All Implemented Interfaces:
DateHolder

public class FinishedSession extends Object implements DateHolder
  • Constructor Details

    • FinishedSession

      public FinishedSession(UUID playerUUID, ServerUUID serverUUID, long start, long end, long afkTime, DataMap extraData)
  • Method Details

    • getPlayerUUID

      public 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(Long registerDate)
    • isFirstSession

      public boolean isFirstSession()
    • getExtraData

      public DataMap getExtraData()
    • getExtraData

      public <T> Optional<T> getExtraData(Class<T> ofType)
    • getDate

      public long getDate()
      Description copied from interface: DateHolder
      Get the date the object holds.
      Specified by:
      getDate in interface DateHolder
      Returns:
      Epoch ms - milliseconds passed since January 1st 1970.
    • deserializeCSV

      public static Optional<FinishedSession> deserializeCSV(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
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • serializeCSV

      public String serializeCSV()
      Serialize into csv format.
      Returns:
      Serialized format