java.lang.Object
net.andresbustamante.yafoot.core.model.Match
All Implemented Interfaces:
Serializable, Auditable, Identifiable<Integer>

public final class Match extends Object implements Serializable, Identifiable<Integer>, Auditable
A match planned by a player.
Author:
andresbustamante
See Also:
  • Constructor Details

    • Match

      public Match()
      Main constructor.
    • Match

      public Match(Integer id)
      Constructor for testing purposes.
      Parameters:
      id - Identifier to give to the match
  • Method Details

    • isPlayerRegistered

      public boolean isPlayerRegistered(Player player)
      Indicates whether a player is registered on the current match.
      Parameters:
      player - Player to check
      Returns:
      True if the player is already registered on this match
    • isAcceptingRegistrations

      public boolean isAcceptingRegistrations()
      A match is accepting registrations if the date of the match is in the future and the number of players expected is still higher than the number of players registered for the match.
      Returns:
      True if the match is still accepting registrations
    • getNumRegisteredPlayers

      public Integer getNumRegisteredPlayers()
      Counts the number of registered players on the current match.
      Returns:
      Number of registered players