SudokuFX
Loading...
Searching...
No Matches
fr.softsf.sudokufx.model.Player Class Reference

Represents a player in the SudokuFX application. More...

+ Collaboration diagram for fr.softsf.sudokufx.model.Player:

Classes

class  PlayerBuilder
 Builder class for creating Player instances with fluent API. More...
 

Public Member Functions

 Player (Long playerid, @Nonnull @NotNull PlayerLanguage playerlanguageid, @Nonnull @NotNull Options optionsid, @Nonnull @NotNull Menu menuid, Set< Game > games, @Nonnull @NotNull String name, boolean selected, @Nonnull @NotNull Instant createdat, @Nonnull @NotNull Instant updatedat)
 Full constructor to initialize all fields of Player.
 
boolean equals (Object o)
 Compares two Player objects for equality based on all fields.
 
Instant getCreatedat ()
 Returns the creation timestamp.
 
Set< GamegetGames ()
 Returns the games played by the player.
 
Menu getMenuid ()
 Returns the menu associated with the player.
 
String getName ()
 Returns the name of the player.
 
Options getOptionsid ()
 Returns the options associated with the player.
 
Long getPlayerid ()
 Returns the unique ID of the player.
 
PlayerLanguage getPlayerlanguageid ()
 Returns the language of the player.
 
boolean getSelected ()
 Returns whether the player is selected.
 
Instant getUpdatedat ()
 Returns the update timestamp.
 
int hashCode ()
 Computes the hash code based on all fields.
 
void setGames (Set< Game > games)
 Sets the games.
 
void setMenuid (@Nonnull Menu menuid)
 Sets the menu after validation.
 
void setName (@Nonnull String name)
 Sets the name after validation.
 
void setOptionsid (@Nonnull Options optionsid)
 Sets the options after validation.
 
void setPlayerlanguageid (@Nonnull PlayerLanguage playerlanguageid)
 Sets the language after validation.
 
void setSelected (boolean selected)
 Sets the selection flag.
 
void setUpdatedat (@Nonnull Instant updatedat)
 Sets the update timestamp after validation.
 
String toString ()
 Returns a string representation of the Player object.
 

Static Public Member Functions

static PlayerBuilder builder ()
 Returns a new PlayerBuilder instance for fluent construction.
 

Protected Member Functions

 Player ()
 Protected default constructor for JPA.
 

Static Private Member Functions

static Instant validateCreatedAt (Instant createdat)
 Validates that the creation date is not null.
 
static Menu validateMenu (Menu menuid)
 Validates that the menu is not null.
 
static String validateName (String name)
 Validates that the name is not null.
 
static Options validateOptions (Options optionsid)
 Validates that the options are not null.
 
static PlayerLanguage validatePlayerLanguage (PlayerLanguage playerlanguageid)
 Validates that the player language is not null.
 
static Instant validateUpdatedAt (Instant updatedat)
 Validates that the update date is not null.
 

Private Attributes

Instant createdat = Instant.now()
 Creation timestamp of the player.
 
Set< Gamegames = new LinkedHashSet<>()
 Games played by the player.
 
Menu menuid
 Menu associated with the player.
 
String name = ""
 Name of the player.
 
Options optionsid
 Options associated with the player.
 
Long playerid
 Unique identifier of the player (primary key).
 
PlayerLanguage playerlanguageid
 Language of the player.
 
boolean selected = false
 Flag indicating whether this player is selected.
 
Instant updatedat = Instant.now()
 Last update timestamp of the player.
 

Static Private Attributes

static final String CREATEDAT_MUST_NOT_BE_NULL = "createdat must not be null"
 
static final String MENU_MUST_NOT_BE_NULL = "menu must not be null"
 
static final String NAME_MUST_NOT_BE_NULL = "name must not be null"
 
static final String OPTIONSID_MUST_NOT_BE_NULL = "optionsid must not be null"
 
static final String PLAYERLANGUAGEID_MUST_NOT_BE_NULL
 
static final String UPDATEDAT_MUST_NOT_BE_NULL = "updatedat must not be null"
 

Detailed Description

Represents a player in the SudokuFX application.

Includes the player's language, options, menu, games, name, selection status, and timestamps. Provides fluent builder, validation, and standard object methods.

Constructor & Destructor Documentation

◆ Player() [1/2]

fr.softsf.sudokufx.model.Player.Player ( )
protected

Protected default constructor for JPA.

+ Here is the call graph for this function:

◆ Player() [2/2]

fr.softsf.sudokufx.model.Player.Player ( Long playerid,
@Nonnull @NotNull PlayerLanguage playerlanguageid,
@Nonnull @NotNull Options optionsid,
@Nonnull @NotNull Menu menuid,
Set< Game > games,
@Nonnull @NotNull String name,
boolean selected,
@Nonnull @NotNull Instant createdat,
@Nonnull @NotNull Instant updatedat )

Full constructor to initialize all fields of Player.

Parameters
playeridunique ID
playerlanguageidlanguage of the player
optionsidplayer's options
menuidplayer's menu
gamesgames associated with the player
namename of the player
selectedwhether the player is selected
createdatcreation timestamp
updatedatupdate timestamp
+ Here is the call graph for this function:

Member Function Documentation

◆ builder()

static PlayerBuilder fr.softsf.sudokufx.model.Player.builder ( )
static

Returns a new PlayerBuilder instance for fluent construction.

◆ equals()

boolean fr.softsf.sudokufx.model.Player.equals ( Object o)

Compares two Player objects for equality based on all fields.

+ Here is the call graph for this function:

◆ getCreatedat()

Instant fr.softsf.sudokufx.model.Player.getCreatedat ( )

Returns the creation timestamp.

◆ getGames()

Set< Game > fr.softsf.sudokufx.model.Player.getGames ( )

Returns the games played by the player.

◆ getMenuid()

Menu fr.softsf.sudokufx.model.Player.getMenuid ( )

Returns the menu associated with the player.

◆ getName()

String fr.softsf.sudokufx.model.Player.getName ( )

Returns the name of the player.

◆ getOptionsid()

Options fr.softsf.sudokufx.model.Player.getOptionsid ( )

Returns the options associated with the player.

◆ getPlayerid()

Long fr.softsf.sudokufx.model.Player.getPlayerid ( )

Returns the unique ID of the player.

◆ getPlayerlanguageid()

PlayerLanguage fr.softsf.sudokufx.model.Player.getPlayerlanguageid ( )

Returns the language of the player.

◆ getSelected()

boolean fr.softsf.sudokufx.model.Player.getSelected ( )

Returns whether the player is selected.

◆ getUpdatedat()

Instant fr.softsf.sudokufx.model.Player.getUpdatedat ( )

Returns the update timestamp.

◆ hashCode()

int fr.softsf.sudokufx.model.Player.hashCode ( )

Computes the hash code based on all fields.

◆ setGames()

void fr.softsf.sudokufx.model.Player.setGames ( Set< Game > games)

Sets the games.

◆ setMenuid()

void fr.softsf.sudokufx.model.Player.setMenuid ( @Nonnull Menu menuid)

Sets the menu after validation.

+ Here is the call graph for this function:

◆ setName()

void fr.softsf.sudokufx.model.Player.setName ( @Nonnull String name)

Sets the name after validation.

+ Here is the call graph for this function:

◆ setOptionsid()

void fr.softsf.sudokufx.model.Player.setOptionsid ( @Nonnull Options optionsid)

Sets the options after validation.

+ Here is the call graph for this function:

◆ setPlayerlanguageid()

void fr.softsf.sudokufx.model.Player.setPlayerlanguageid ( @Nonnull PlayerLanguage playerlanguageid)

Sets the language after validation.

+ Here is the call graph for this function:

◆ setSelected()

void fr.softsf.sudokufx.model.Player.setSelected ( boolean selected)

Sets the selection flag.

◆ setUpdatedat()

void fr.softsf.sudokufx.model.Player.setUpdatedat ( @Nonnull Instant updatedat)

Sets the update timestamp after validation.

+ Here is the call graph for this function:

◆ toString()

String fr.softsf.sudokufx.model.Player.toString ( )

Returns a string representation of the Player object.

◆ validateCreatedAt()

static Instant fr.softsf.sudokufx.model.Player.validateCreatedAt ( Instant createdat)
staticprivate

Validates that the creation date is not null.

◆ validateMenu()

static Menu fr.softsf.sudokufx.model.Player.validateMenu ( Menu menuid)
staticprivate

Validates that the menu is not null.

◆ validateName()

static String fr.softsf.sudokufx.model.Player.validateName ( String name)
staticprivate

Validates that the name is not null.

◆ validateOptions()

static Options fr.softsf.sudokufx.model.Player.validateOptions ( Options optionsid)
staticprivate

Validates that the options are not null.

◆ validatePlayerLanguage()

static PlayerLanguage fr.softsf.sudokufx.model.Player.validatePlayerLanguage ( PlayerLanguage playerlanguageid)
staticprivate

Validates that the player language is not null.

◆ validateUpdatedAt()

static Instant fr.softsf.sudokufx.model.Player.validateUpdatedAt ( Instant updatedat)
staticprivate

Validates that the update date is not null.

Member Data Documentation

◆ createdat

Instant fr.softsf.sudokufx.model.Player.createdat = Instant.now()
private

Creation timestamp of the player.

◆ CREATEDAT_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Player.CREATEDAT_MUST_NOT_BE_NULL = "createdat must not be null"
staticprivate

◆ games

Set<Game> fr.softsf.sudokufx.model.Player.games = new LinkedHashSet<>()
private

Games played by the player.

◆ MENU_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Player.MENU_MUST_NOT_BE_NULL = "menu must not be null"
staticprivate

◆ menuid

Menu fr.softsf.sudokufx.model.Player.menuid
private

Menu associated with the player.

◆ name

String fr.softsf.sudokufx.model.Player.name = ""
private

Name of the player.

◆ NAME_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Player.NAME_MUST_NOT_BE_NULL = "name must not be null"
staticprivate

◆ optionsid

Options fr.softsf.sudokufx.model.Player.optionsid
private

Options associated with the player.

◆ OPTIONSID_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Player.OPTIONSID_MUST_NOT_BE_NULL = "optionsid must not be null"
staticprivate

◆ playerid

Long fr.softsf.sudokufx.model.Player.playerid
private

Unique identifier of the player (primary key).

◆ playerlanguageid

PlayerLanguage fr.softsf.sudokufx.model.Player.playerlanguageid
private

Language of the player.

◆ PLAYERLANGUAGEID_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Player.PLAYERLANGUAGEID_MUST_NOT_BE_NULL
staticprivate
Initial value:
=
"playerlanguageid must not be null"

◆ selected

boolean fr.softsf.sudokufx.model.Player.selected = false
private

Flag indicating whether this player is selected.

◆ updatedat

Instant fr.softsf.sudokufx.model.Player.updatedat = Instant.now()
private

Last update timestamp of the player.

◆ UPDATEDAT_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Player.UPDATEDAT_MUST_NOT_BE_NULL = "updatedat must not be null"
staticprivate

The documentation for this class was generated from the following file: