Record Class PlayTime

java.lang.Object
java.lang.Record
net.flectone.pulse.model.value.PlayTime
Record Components:
id - the database id
playerId - the player this row belongs to
first - when the player was first seen, in milliseconds
last - when the player was last seen, in milliseconds
total - the total time played, in milliseconds
sessions - how many times the player has joined

public record PlayTime(int id, int playerId, long first, long last, long total, int sessions) extends Record
Aggregated session statistics for a single player.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayTime(int id, int playerId, long first, long last, long total, int sessions)
    Creates an instance of a PlayTime record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the first record component.
    final int
    Returns a hash code value for this object.
    int
    id()
    Returns the value of the id record component.
    long
    Returns the value of the last record component.
    int
    Returns the value of the playerId record component.
    int
    Returns the value of the sessions record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the total record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PlayTime

      public PlayTime(int id, int playerId, long first, long last, long total, int sessions)
      Creates an instance of a PlayTime record class.
      Parameters:
      id - the value for the id record component
      playerId - the value for the playerId record component
      first - the value for the first record component
      last - the value for the last record component
      total - the value for the total record component
      sessions - the value for the sessions record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • playerId

      public int playerId()
      Returns the value of the playerId record component.
      Returns:
      the value of the playerId record component
    • first

      public long first()
      Returns the value of the first record component.
      Returns:
      the value of the first record component
    • last

      public long last()
      Returns the value of the last record component.
      Returns:
      the value of the last record component
    • total

      public long total()
      Returns the value of the total record component.
      Returns:
      the value of the total record component
    • sessions

      public int sessions()
      Returns the value of the sessions record component.
      Returns:
      the value of the sessions record component