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

Represents a Sudoku grid with default values, current values, and the number of possibilities. More...

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

Classes

class  GridBuilder
 Builder class for creating Grid instances. More...
 

Public Member Functions

 Grid (Long gridid, @Nonnull @NotNull String defaultgridvalue, @Nonnull @NotNull String gridvalue, byte possibilities)
 Full constructor to initialize a grid with all fields.
 
boolean equals (Object obj)
 Compares this grid with another object for equality based on all fields.
 
String getDefaultgridvalue ()
 Returns the default grid values.
 
Long getGridid ()
 Returns the unique identifier of the grid.
 
String getGridvalue ()
 Returns the current grid values.
 
byte getPossibilities ()
 Returns the percentage of possibilities for this grid.
 
int hashCode ()
 Computes the hash code based on all fields.
 
void setDefaultgridvalue (@Nonnull String defaultgridvalue)
 Sets the default grid values.
 
void setGridvalue (@Nonnull String gridvalue)
 Sets the current grid values.
 
void setPossibilities (byte possibilities)
 Sets the percentage of possibilities for this grid.
 
String toString ()
 Returns a string representation of the grid.
 

Static Public Member Functions

static GridBuilder builder ()
 Creates a new GridBuilder for fluent construction of Grid instances.
 

Protected Member Functions

 Grid ()
 Protected default constructor for JPA.
 

Static Private Member Functions

static String validateDefaultgridvalue (String defaultgridvalue)
 Validates that the default grid value is not null.
 
static String validateGridvalue (String gridvalue)
 Validates that the grid value is not null.
 

Private Attributes

String defaultgridvalue = EMPTY_GRID
 Default values of the grid (length up to 81).
 
Long gridid
 Unique identifier of the grid (primary key).
 
String gridvalue = EMPTY_GRID
 Current values of the grid (length up to 810).
 
byte possibilities
 Percentage of possibilities for this grid, between 0 and 100.
 

Static Private Attributes

static final String DEFAULTGRIDVALUE_MUST_NOT_BE_NULL
 
static final String EMPTY_GRID = ""
 
static final String GRIDVALUE_MUST_NOT_BE_NULL = "gridvalue must not be null"
 

Detailed Description

Represents a Sudoku grid with default values, current values, and the number of possibilities.

Provides getters, setters, validation, and a builder for fluent construction.

Constructor & Destructor Documentation

◆ Grid() [1/2]

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

Protected default constructor for JPA.

+ Here is the call graph for this function:

◆ Grid() [2/2]

fr.softsf.sudokufx.model.Grid.Grid ( Long gridid,
@Nonnull @NotNull String defaultgridvalue,
@Nonnull @NotNull String gridvalue,
byte possibilities )

Full constructor to initialize a grid with all fields.

Parameters
grididthe unique ID of the grid
defaultgridvaluethe default grid values
gridvaluethe current grid values
possibilitiesthe percentage of possibilities (0–100)
+ Here is the call graph for this function:

Member Function Documentation

◆ builder()

static GridBuilder fr.softsf.sudokufx.model.Grid.builder ( )
static

Creates a new GridBuilder for fluent construction of Grid instances.

◆ equals()

boolean fr.softsf.sudokufx.model.Grid.equals ( Object obj)

Compares this grid with another object for equality based on all fields.

+ Here is the call graph for this function:

◆ getDefaultgridvalue()

String fr.softsf.sudokufx.model.Grid.getDefaultgridvalue ( )

Returns the default grid values.

◆ getGridid()

Long fr.softsf.sudokufx.model.Grid.getGridid ( )

Returns the unique identifier of the grid.

◆ getGridvalue()

String fr.softsf.sudokufx.model.Grid.getGridvalue ( )

Returns the current grid values.

◆ getPossibilities()

byte fr.softsf.sudokufx.model.Grid.getPossibilities ( )

Returns the percentage of possibilities for this grid.

◆ hashCode()

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

Computes the hash code based on all fields.

◆ setDefaultgridvalue()

void fr.softsf.sudokufx.model.Grid.setDefaultgridvalue ( @Nonnull String defaultgridvalue)

Sets the default grid values.

+ Here is the call graph for this function:

◆ setGridvalue()

void fr.softsf.sudokufx.model.Grid.setGridvalue ( @Nonnull String gridvalue)

Sets the current grid values.

+ Here is the call graph for this function:

◆ setPossibilities()

void fr.softsf.sudokufx.model.Grid.setPossibilities ( byte possibilities)

Sets the percentage of possibilities for this grid.

◆ toString()

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

Returns a string representation of the grid.

◆ validateDefaultgridvalue()

static String fr.softsf.sudokufx.model.Grid.validateDefaultgridvalue ( String defaultgridvalue)
staticprivate

Validates that the default grid value is not null.

Parameters
defaultgridvaluethe default grid value to validate
Returns
the validated default grid value
Exceptions
NullPointerExceptionif the default grid value is null

◆ validateGridvalue()

static String fr.softsf.sudokufx.model.Grid.validateGridvalue ( String gridvalue)
staticprivate

Validates that the grid value is not null.

Parameters
gridvaluethe grid value to validate
Returns
the validated grid value
Exceptions
NullPointerExceptionif the grid value is null

Member Data Documentation

◆ defaultgridvalue

String fr.softsf.sudokufx.model.Grid.defaultgridvalue = EMPTY_GRID
private

Default values of the grid (length up to 81).

◆ DEFAULTGRIDVALUE_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Grid.DEFAULTGRIDVALUE_MUST_NOT_BE_NULL
staticprivate
Initial value:
=
"defaultgridvalue must not be null"

◆ EMPTY_GRID

final String fr.softsf.sudokufx.model.Grid.EMPTY_GRID = ""
staticprivate

◆ gridid

Long fr.softsf.sudokufx.model.Grid.gridid
private

Unique identifier of the grid (primary key).

◆ gridvalue

String fr.softsf.sudokufx.model.Grid.gridvalue = EMPTY_GRID
private

Current values of the grid (length up to 810).

◆ GRIDVALUE_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Grid.GRIDVALUE_MUST_NOT_BE_NULL = "gridvalue must not be null"
staticprivate

◆ possibilities

byte fr.softsf.sudokufx.model.Grid.possibilities
private

Percentage of possibilities for this grid, between 0 and 100.


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