Class Match
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 -
Method Summary
Modifier and TypeMethodDescriptionCounts 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
isPlayerRegistered
(Player player) 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
Constructor for testing purposes.- Parameters:
id
- Identifier to give to the match
-
-
Method Details
-
isPlayerRegistered
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
Counts the number of registered players on the current match.- Returns:
- Number of registered players
-