Class LeaderboardEntryDTO

java.lang.Object
webb.shared.dtos.leaderboard.LeaderboardEntryDTO
All Implemented Interfaces:
Comparable<LeaderboardEntryDTO>

public class LeaderboardEntryDTO extends Object implements Comparable<LeaderboardEntryDTO>
  • Constructor Details

    • LeaderboardEntryDTO

      public LeaderboardEntryDTO(String username, int completedPuzzles)
      Create a leaderboard entry object
      Parameters:
      username - of the person
      completedPuzzles - number of puzzles they have created
  • Method Details

    • getUsername

      public String getUsername()
      Returns:
      the username of the user
    • getCompletedPuzzles

      public int getCompletedPuzzles()
      Returns:
      the amount of puzzles they have finished
    • compareTo

      public int compareTo(LeaderboardEntryDTO o)
      Sorts by completed puzzles highest to lowest Tiebreaker is alphabetical order
      Specified by:
      compareTo in interface Comparable<LeaderboardEntryDTO>
      Returns:
      the comparison