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

Represents user-configurable options for the SudokuFX application. More...

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

Classes

class  OptionsBuilder
 Builder class for creating Options instances with fluent API. More...
 

Public Member Functions

 Options (Long optionsid, @Nonnull @NotNull String hexcolor, @Nonnull @NotNull String imagepath, @Nonnull @NotNull String songpath, boolean opaque, boolean muted)
 Full constructor to initialize all fields of options.
 
boolean equals (Object obj)
 Compares two Options objects for equality based on all fields.
 
String getHexcolor ()
 Returns the ARGB hex color string.
 
String getImagepath ()
 Returns the background image path.
 
boolean getMuted ()
 Returns true if the background song is muted.
 
boolean getOpaque ()
 Returns true if the background image is opaque.
 
Long getOptionsid ()
 Returns the unique ID of this Options instance.
 
String getSongpath ()
 Returns the background song path.
 
int hashCode ()
 Computes the hash code based on all fields.
 
void setHexcolor (@Nonnull String hexcolor)
 Sets the ARGB hex color after validation.
 
void setImagepath (@Nonnull String imagepath)
 Sets the background image path after validation.
 
void setMuted (boolean muted)
 Sets whether the background song is muted.
 
void setOpaque (boolean opaque)
 Sets whether the background image is opaque.
 
void setSongpath (@Nonnull String songpath)
 Sets the background song path after validation.
 
String toString ()
 Returns a string representation of the Options object.
 

Static Public Member Functions

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

Protected Member Functions

 Options ()
 Protected default constructor for JPA.
 

Static Private Member Functions

static String validateHexcolor (String hexcolor)
 Validates that the hex color is non-blank and conforms to ARGB 8-character hex format.
 
static String validatePath (String path, String nullMsg)
 Validates a file path for non-null and maximum length.
 

Private Attributes

String hexcolor = DEFAULT_HEX_COLOR
 Background color in ARGB hex format (e.g., FFFFFFFF).
 
String imagepath = EMPTY_PATH
 Path to the background image file.
 
boolean muted = true
 Flag indicating if the background music is muted.
 
boolean opaque = true
 Flag indicating if the background image is opaque.
 
Long optionsid
 Unique identifier of the options (primary key).
 
String songpath = EMPTY_PATH
 Path to the background song file.
 

Static Private Attributes

static final String DEFAULT_HEX_COLOR = "FFFFFFFF"
 
static final String EMPTY_PATH = ""
 
static final Pattern HEX_COLOR_PATTERN = Pattern.compile("^([A-Fa-f0-9]{8})$")
 
static final String HEXCOLOR_MUST_NOT_BE_NULL_OR_BLANK
 
static final String IMAGEPATH_MUST_NOT_BE_NULL = "imagepath must not be null"
 
static final String INVALID_HEX_COLOR_FORMAT
 
static final int MAX_PATH_LENGTH = 260
 
static final String SONGPATH_MUST_NOT_BE_NULL = "songpath must not be null"
 

Detailed Description

Represents user-configurable options for the SudokuFX application.

Includes background color, image and song paths, and flags for image usage, opacity, and muting. Provides fluent builder, validation, and standard object methods.

Constructor & Destructor Documentation

◆ Options() [1/2]

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

Protected default constructor for JPA.

+ Here is the call graph for this function:

◆ Options() [2/2]

fr.softsf.sudokufx.model.Options.Options ( Long optionsid,
@Nonnull @NotNull String hexcolor,
@Nonnull @NotNull String imagepath,
@Nonnull @NotNull String songpath,
boolean opaque,
boolean muted )

Full constructor to initialize all fields of options.

Parameters
optionsidunique ID of the options
hexcolorbackground color in ARGB hex format
imagepathpath to background image
songpathpath to background song
opaquetrue if the image is opaque
mutedtrue if the song is muted
+ Here is the call graph for this function:

Member Function Documentation

◆ builder()

static OptionsBuilder fr.softsf.sudokufx.model.Options.builder ( )
static

Returns a new OptionsBuilder instance for fluent construction.

◆ equals()

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

Compares two Options objects for equality based on all fields.

+ Here is the call graph for this function:

◆ getHexcolor()

String fr.softsf.sudokufx.model.Options.getHexcolor ( )

Returns the ARGB hex color string.

◆ getImagepath()

String fr.softsf.sudokufx.model.Options.getImagepath ( )

Returns the background image path.

◆ getMuted()

boolean fr.softsf.sudokufx.model.Options.getMuted ( )

Returns true if the background song is muted.

◆ getOpaque()

boolean fr.softsf.sudokufx.model.Options.getOpaque ( )

Returns true if the background image is opaque.

◆ getOptionsid()

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

Returns the unique ID of this Options instance.

◆ getSongpath()

String fr.softsf.sudokufx.model.Options.getSongpath ( )

Returns the background song path.

◆ hashCode()

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

Computes the hash code based on all fields.

◆ setHexcolor()

void fr.softsf.sudokufx.model.Options.setHexcolor ( @Nonnull String hexcolor)

Sets the ARGB hex color after validation.

+ Here is the call graph for this function:

◆ setImagepath()

void fr.softsf.sudokufx.model.Options.setImagepath ( @Nonnull String imagepath)

Sets the background image path after validation.

+ Here is the call graph for this function:

◆ setMuted()

void fr.softsf.sudokufx.model.Options.setMuted ( boolean muted)

Sets whether the background song is muted.

◆ setOpaque()

void fr.softsf.sudokufx.model.Options.setOpaque ( boolean opaque)

Sets whether the background image is opaque.

◆ setSongpath()

void fr.softsf.sudokufx.model.Options.setSongpath ( @Nonnull String songpath)

Sets the background song path after validation.

+ Here is the call graph for this function:

◆ toString()

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

Returns a string representation of the Options object.

◆ validateHexcolor()

static String fr.softsf.sudokufx.model.Options.validateHexcolor ( String hexcolor)
staticprivate

Validates that the hex color is non-blank and conforms to ARGB 8-character hex format.

Parameters
hexcolorthe color string to validate
Returns
validated hex color
Exceptions
IllegalArgumentExceptionif hexcolor is blank or invalid

◆ validatePath()

static String fr.softsf.sudokufx.model.Options.validatePath ( String path,
String nullMsg )
staticprivate

Validates a file path for non-null and maximum length.

Parameters
pathpath string to validate
nullMsgexception message if path is null
Returns
validated path
Exceptions
NullPointerExceptionif path is null
IllegalArgumentExceptionif path exceeds MAX_PATH_LENGTH

Member Data Documentation

◆ DEFAULT_HEX_COLOR

final String fr.softsf.sudokufx.model.Options.DEFAULT_HEX_COLOR = "FFFFFFFF"
staticprivate

◆ EMPTY_PATH

final String fr.softsf.sudokufx.model.Options.EMPTY_PATH = ""
staticprivate

◆ HEX_COLOR_PATTERN

final Pattern fr.softsf.sudokufx.model.Options.HEX_COLOR_PATTERN = Pattern.compile("^([A-Fa-f0-9]{8})$")
staticprivate

◆ hexcolor

String fr.softsf.sudokufx.model.Options.hexcolor = DEFAULT_HEX_COLOR
private

Background color in ARGB hex format (e.g., FFFFFFFF).

◆ HEXCOLOR_MUST_NOT_BE_NULL_OR_BLANK

final String fr.softsf.sudokufx.model.Options.HEXCOLOR_MUST_NOT_BE_NULL_OR_BLANK
staticprivate
Initial value:
=
"hexcolor must not be null or blank"

◆ imagepath

String fr.softsf.sudokufx.model.Options.imagepath = EMPTY_PATH
private

Path to the background image file.

◆ IMAGEPATH_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Options.IMAGEPATH_MUST_NOT_BE_NULL = "imagepath must not be null"
staticprivate

◆ INVALID_HEX_COLOR_FORMAT

final String fr.softsf.sudokufx.model.Options.INVALID_HEX_COLOR_FORMAT
staticprivate
Initial value:
=
"hexcolor must be a valid hex color format (e.g., FFFFFFFF)"

◆ MAX_PATH_LENGTH

final int fr.softsf.sudokufx.model.Options.MAX_PATH_LENGTH = 260
staticprivate

◆ muted

boolean fr.softsf.sudokufx.model.Options.muted = true
private

Flag indicating if the background music is muted.

◆ opaque

boolean fr.softsf.sudokufx.model.Options.opaque = true
private

Flag indicating if the background image is opaque.

◆ optionsid

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

Unique identifier of the options (primary key).

◆ songpath

String fr.softsf.sudokufx.model.Options.songpath = EMPTY_PATH
private

Path to the background song file.

◆ SONGPATH_MUST_NOT_BE_NULL

final String fr.softsf.sudokufx.model.Options.SONGPATH_MUST_NOT_BE_NULL = "songpath must not be null"
staticprivate

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