Class ActivityTimestamps

java.lang.Object
de.jcm.discordgamesdk.activity.ActivityTimestamps

public class ActivityTimestamps extends Object
A structure used to make "elapsed" and "remaining" durations.
See Also:
  • Constructor Details

    • ActivityTimestamps

      public ActivityTimestamps()
  • Method Details

    • setStart

      public void setStart(Instant start)

      Sets the time the user started playing.

      If the end timestamp (setEnd(java.time.Instant)) is set as well, this cause a progress indicator to show up.

      Otherwise, this causes an "elapsed" duration to show up.

      Parameters:
      start - Start time
    • getStart

      public Instant getStart()
      Gets the time the user started playing.
      Returns:
      Start time
    • setEnd

      public void setEnd(Instant end)

      Sets the time the user will be done.

      If the start timestamp (setStart(java.time.Instant)) is set as well, this cause a progress indicator to show up.

      This causes a "remaining" duration to show up.

      Parameters:
      end - End time
    • getEnd

      public Instant getEnd()
      Gets the time the user will be done.
      Returns:
      End time
    • setStartAndEnd

      public void setStartAndEnd(Instant start, Instant end)

      Sets both start and end time of the activity simultaneously.

      This causes a progress indicator to show up.

      This method exists purely for convenience and is equivalent to calling setStart(java.time.Instant) and setEnd(java.time.Instant) individually.

      Parameters:
      start - Start time
      end - End time
    • clearStart

      public void clearStart()
      Clears the start time.
    • clearEnd

      public void clearEnd()
      Clears the end time.
    • clear

      public void clear()

      Clears both start and end time simultaneously.

      This method exists purely for convenience and is equivalent to calling clearStart() and clearEnd() individually.