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

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

    Constructors
    Constructor
    Description
    Main constructor.
    Constructor for testing purposes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Counts the number of registered players on the current match.
    boolean
    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.
    boolean
    Indicates whether a player is registered on the current match.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.andresbustamante.yafoot.commons.model.Auditable

    getCreationDate, getModificationDate

    Methods inherited from interface net.andresbustamante.yafoot.commons.model.Identifiable

    getId
  • 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