![]() |
SudokuFX
|
Represents a Sudoku game instance stored in the database. More...
Collaboration diagram for fr.softsf.sudokufx.model.Game:Classes | |
| class | GameBuilder |
Builder class to create Game instances in a fluent style. More... | |
Public Member Functions | |
| Game (Long gameid, @Nonnull @NotNull Grid gridid, @Nonnull @NotNull Player playerid, @Nonnull @NotNull GameLevel levelid, boolean selected, @Nonnull @NotNull Instant createdat, @Nonnull @NotNull Instant updatedat) | |
| Full constructor initializing all fields of the game. | |
| void | detachFromPlayer () |
| Detaches this game from its current player. | |
| boolean | equals (Object o) |
| Compares this game with another object for equality based on all fields. | |
| Instant | getCreatedat () |
| Returns the creation timestamp. | |
| Long | getGameid () |
| Returns the unique ID of the game. | |
| Grid | getGridid () |
Returns the Grid associated with this game. | |
| GameLevel | getLevelid () |
Returns the GameLevel of this game. | |
| Player | getPlayerid () |
Returns the Player associated with this game. | |
| boolean | getSelected () |
| Returns whether the game is currently selected. | |
| Instant | getUpdatedat () |
| Returns the last update timestamp. | |
| int | hashCode () |
| Computes the hash code based on all fields. | |
| void | setPlayerid (@Nonnull Player playerid) |
| Sets the player associated with this game. | |
| void | setSelected (boolean selected) |
| Sets the selection state of this game. | |
| void | setUpdatedat (@Nonnull Instant updatedat) |
| Updates the last modified timestamp. | |
| String | toString () |
| Returns a string representation of the game. | |
Static Public Member Functions | |
| static GameBuilder | builder () |
Creates a new GameBuilder for fluent construction. | |
Protected Member Functions | |
| Game () | |
| Protected default constructor for JPA. | |
Static Private Member Functions | |
| static Instant | validateCreatedAt (Instant createdat) |
| Ensures that the creation timestamp is not null. | |
| static Grid | validateGrid (Grid grid) |
Ensures that the Grid is not null. | |
| static GameLevel | validateLevel (GameLevel level) |
Ensures that the GameLevel is not null. | |
| static Player | validatePlayer (Player player) |
Ensures that the Player is not null. | |
| static Instant | validateUpdatedAt (Instant updatedat) |
| Ensures that the update timestamp is not null. | |
Private Attributes | |
| Instant | createdat = Instant.now() |
| Timestamp when this game was created. | |
| Long | gameid |
| Unique identifier of the game (primary key). | |
| Grid | gridid |
| The grid associated with this game. | |
| GameLevel | levelid |
| The difficulty level of this game. | |
| Player | playerid |
| The player who owns this game. | |
| boolean | selected = false |
| Whether this game is currently selected. | |
| Instant | updatedat = Instant.now() |
| Timestamp when this game was last updated. | |
Static Private Attributes | |
| static final String | CREATEDAT_MUST_NOT_BE_NULL = "createdat must not be null" |
| static final String | GRIDID_MUST_NOT_BE_NULL = "gridid must not be null" |
| static final String | LEVELID_MUST_NOT_BE_NULL = "levelid must not be null" |
| static final String | PLAYERID_MUST_NOT_BE_NULL = "playerid must not be null" |
| static final String | UPDATEDAT_MUST_NOT_BE_NULL = "updatedat must not be null" |
Represents a Sudoku game instance stored in the database.
Contains references to the Grid, Player, and GameLevel. Tracks creation and update timestamps, selection state, and provides builders and validation methods.
|
protected |
Protected default constructor for JPA.
Here is the call graph for this function:| fr.softsf.sudokufx.model.Game.Game | ( | Long | gameid, |
| @Nonnull @NotNull Grid | gridid, | ||
| @Nonnull @NotNull Player | playerid, | ||
| @Nonnull @NotNull GameLevel | levelid, | ||
| boolean | selected, | ||
| @Nonnull @NotNull Instant | createdat, | ||
| @Nonnull @NotNull Instant | updatedat ) |
Full constructor initializing all fields of the game.
| gameid | the unique game ID |
| gridid | the grid associated with this game |
| playerid | the player associated with this game |
| levelid | the game level |
| selected | whether the game is selected |
| createdat | creation timestamp |
| updatedat | last update timestamp |
Here is the call graph for this function:
|
static |
Creates a new GameBuilder for fluent construction.
| void fr.softsf.sudokufx.model.Game.detachFromPlayer | ( | ) |
Detaches this game from its current player.
| boolean fr.softsf.sudokufx.model.Game.equals | ( | Object | o | ) |
Compares this game with another object for equality based on all fields.
Here is the call graph for this function:| Instant fr.softsf.sudokufx.model.Game.getCreatedat | ( | ) |
Returns the creation timestamp.
| Long fr.softsf.sudokufx.model.Game.getGameid | ( | ) |
Returns the unique ID of the game.
| boolean fr.softsf.sudokufx.model.Game.getSelected | ( | ) |
Returns whether the game is currently selected.
| Instant fr.softsf.sudokufx.model.Game.getUpdatedat | ( | ) |
Returns the last update timestamp.
| int fr.softsf.sudokufx.model.Game.hashCode | ( | ) |
Computes the hash code based on all fields.
| void fr.softsf.sudokufx.model.Game.setPlayerid | ( | @Nonnull Player | playerid | ) |
Sets the player associated with this game.
Here is the call graph for this function:| void fr.softsf.sudokufx.model.Game.setSelected | ( | boolean | selected | ) |
Sets the selection state of this game.
| void fr.softsf.sudokufx.model.Game.setUpdatedat | ( | @Nonnull Instant | updatedat | ) |
Updates the last modified timestamp.
Here is the call graph for this function:| String fr.softsf.sudokufx.model.Game.toString | ( | ) |
Returns a string representation of the game.
|
staticprivate |
Ensures that the creation timestamp is not null.
Ensures that the Grid is not null.
Ensures that the GameLevel is not null.
Ensures that the Player is not null.
|
staticprivate |
Ensures that the update timestamp is not null.
|
private |
Timestamp when this game was created.
|
staticprivate |
|
private |
Unique identifier of the game (primary key).
|
private |
The grid associated with this game.
|
staticprivate |
|
private |
The difficulty level of this game.
|
staticprivate |
|
private |
The player who owns this game.
|
staticprivate |
|
private |
Whether this game is currently selected.
|
private |
Timestamp when this game was last updated.
|
staticprivate |