Top Description Constructors Methods
com.dlsc.formsfx.model.validators

public Class SelectionLengthValidator<E>

extends CustomValidator<ObservableList<E>>
Class Inheritance
Imports
javafx.collections.ObservableList

A SelectionLengthValidator checks if a selection list's length is between a minimum and a maximum value.
Authors
Sacha Schmid, Rinesch Murugathas

Constructor Summary

AccessConstructor and Description
private
SelectionLengthValidator(int min, int max, String errorMessage)

Method Summary

Modifier and TypeMethod and Description
public static <T> SelectionLengthValidator<T>

Returns:

Returns a new SelectionLengthValidator.
atLeast
(int
The lower bound for the validation.
min
,
String
The error message that is returned if the validation fails.
errorMessage
)

Creates an SelectionLengthValidator with a given lower bound.

public static <T> SelectionLengthValidator<T>

Returns:

Returns a new SelectionLengthValidator.
between
(int
The lower bound for the validation.
min
,
int
The upper bound for the validation.
max
,
String
The error message that is returned if the validation fails.
errorMessage
)

Creates an SelectionLengthValidator with given lower and upper bounds.

public static <T> SelectionLengthValidator<T>

Returns:

Returns a new SelectionLengthValidator.
exactly
(int
The lower and upper bound for the validation.
value
,
String
The error message that is returned if the validation fails.
errorMessage
)

Creates a SelectionLengthValidator with a given lower and upper bound, which are equal.

public static <T> SelectionLengthValidator<T>

Returns:

Returns a new SelectionLengthValidator.
upTo
(int
The upper bound for the validation.
max
,
String
The error message that is returned if the validation fails.
errorMessage
)

Creates an SelectionLengthValidator with a given upper bound.

Inherited from com.dlsc.formsfx.model.validators.CustomValidator:
forPredicatevalidate

Constructor Detail

SelectionLengthValidatorback to summary
private SelectionLengthValidator(int min, int max, String errorMessage)

Method Detail

atLeastback to summary
public static <T> SelectionLengthValidator<T> atLeast(int min, String errorMessage)

Creates an SelectionLengthValidator with a given lower bound.

Parameters
min:int

The lower bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:SelectionLengthValidator<T>

Returns a new SelectionLengthValidator.

Exceptions
IllegalArgumentException:
Thrown if the minimum is a negative number.
betweenback to summary
public static <T> SelectionLengthValidator<T> between(int min, int max, String errorMessage)

Creates an SelectionLengthValidator with given lower and upper bounds.

Parameters
min:int

The lower bound for the validation.

max:int

The upper bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:SelectionLengthValidator<T>

Returns a new SelectionLengthValidator.

Exceptions
IllegalArgumentException:
Thrown if the minimum is a negative number.
exactlyback to summary
public static <T> SelectionLengthValidator<T> exactly(int value, String errorMessage)

Creates a SelectionLengthValidator with a given lower and upper bound, which are equal.

Parameters
value:int

The lower and upper bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:SelectionLengthValidator<T>

Returns a new SelectionLengthValidator.

upToback to summary
public static <T> SelectionLengthValidator<T> upTo(int max, String errorMessage)

Creates an SelectionLengthValidator with a given upper bound.

Parameters
max:int

The upper bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:SelectionLengthValidator<T>

Returns a new SelectionLengthValidator.