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

Represents a player's language in the SudokuFX application. More...

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

Classes

class  PlayerLanguageBuilder
 Builder class for creating PlayerLanguage instances with fluent API. More...
 

Public Member Functions

 PlayerLanguage (Long playerlanguageid, @Nonnull @NotNull String iso)
 Full constructor to initialize all fields of PlayerLanguage.
 
boolean equals (Object obj)
 Compares two PlayerLanguage objects for equality based on all fields.
 
String getIso ()
 Returns the ISO code of this PlayerLanguage.
 
Long getPlayerlanguageid ()
 Returns the unique ID of this PlayerLanguage instance.
 
int hashCode ()
 Computes the hash code based on all fields.
 
void setIso (@Nonnull String iso)
 Sets the ISO code after validation.
 
String toString ()
 Returns a string representation of the PlayerLanguage object.
 

Static Public Member Functions

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

Protected Member Functions

 PlayerLanguage ()
 Protected default constructor for JPA.
 

Static Private Member Functions

static String validateIso (String iso)
 Validates that the iso is not null and matches allowed values (FR or EN).
 

Private Attributes

String iso = DEFAULT_ISO
 ISO code for the language ("FR" or "EN").
 
Long playerlanguageid
 Unique identifier of the player language (primary key).
 

Static Private Attributes

static final String DEFAULT_ISO = "FR"
 
static final String ISO_INVALID_VALUE = "iso must be either 'FR' or 'EN'"
 
static final String ISO_MUST_NOT_BE_NULL = "iso must not be null"
 
static final java.util.regex.Pattern VALID_ISO_REGEX
 

Detailed Description

Represents a player's language in the SudokuFX application.

Each language is identified by a unique ID and a two-letter ISO code ("FR" or "EN"). Provides fluent builder, validation, and standard object methods.

Constructor & Destructor Documentation

◆ PlayerLanguage() [1/2]

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

Protected default constructor for JPA.

+ Here is the call graph for this function:

◆ PlayerLanguage() [2/2]

fr.softsf.sudokufx.model.PlayerLanguage.PlayerLanguage ( Long playerlanguageid,
@Nonnull @NotNull String iso )

Full constructor to initialize all fields of PlayerLanguage.

Parameters
playerlanguageidunique ID of the language
isotwo-letter ISO code ("FR" or "EN")
+ Here is the call graph for this function:

Member Function Documentation

◆ builder()

static PlayerLanguageBuilder fr.softsf.sudokufx.model.PlayerLanguage.builder ( )
static

Returns a new PlayerLanguageBuilder instance for fluent construction.

◆ equals()

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

Compares two PlayerLanguage objects for equality based on all fields.

+ Here is the call graph for this function:

◆ getIso()

String fr.softsf.sudokufx.model.PlayerLanguage.getIso ( )

Returns the ISO code of this PlayerLanguage.

◆ getPlayerlanguageid()

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

Returns the unique ID of this PlayerLanguage instance.

◆ hashCode()

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

Computes the hash code based on all fields.

◆ setIso()

void fr.softsf.sudokufx.model.PlayerLanguage.setIso ( @Nonnull String iso)

Sets the ISO code after validation.

+ Here is the call graph for this function:

◆ toString()

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

Returns a string representation of the PlayerLanguage object.

◆ validateIso()

static String fr.softsf.sudokufx.model.PlayerLanguage.validateIso ( String iso)
staticprivate

Validates that the iso is not null and matches allowed values (FR or EN).

Parameters
isothe iso to validate
Returns
validated iso
Exceptions
NullPointerExceptionif iso is null
IllegalArgumentExceptionif iso is not FR or EN

Member Data Documentation

◆ DEFAULT_ISO

final String fr.softsf.sudokufx.model.PlayerLanguage.DEFAULT_ISO = "FR"
staticprivate

◆ iso

String fr.softsf.sudokufx.model.PlayerLanguage.iso = DEFAULT_ISO
private

ISO code for the language ("FR" or "EN").

◆ ISO_INVALID_VALUE

final String fr.softsf.sudokufx.model.PlayerLanguage.ISO_INVALID_VALUE = "iso must be either 'FR' or 'EN'"
staticprivate

◆ ISO_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.PlayerLanguage.ISO_MUST_NOT_BE_NULL = "iso must not be null"
staticprivate

◆ playerlanguageid

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

Unique identifier of the player language (primary key).

◆ VALID_ISO_REGEX

final java.util.regex.Pattern fr.softsf.sudokufx.model.PlayerLanguage.VALID_ISO_REGEX
staticprivate
Initial value:
=
java.util.regex.Pattern.compile("^(FR|EN)$")

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