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

public Class IntegerRangeValidator

extends CustomValidator<Integer>
Class Inheritance

A IntegerRangeValidator checks if an integer value is between a minimum and a maximum value.
Authors
Sacha Schmid, Rinesch Murugathas

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public static IntegerRangeValidator

Returns:

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

Creates an IntegerRangeValidator with a given lower bound.

public static IntegerRangeValidator

Returns:

Returns a new IntegerRangeValidator.
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 IntegerRangeValidator with given lower and upper bounds.

public static IntegerRangeValidator

Returns:

Returns a new IntegerRangeValidator.
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 IntegerRangeValidator with a given lower and upper bound, which are equal.

public static IntegerRangeValidator

Returns:

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

Creates an IntegerRangeValidator with a given upper bound.

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

Constructor Detail

IntegerRangeValidatorback to summary
private IntegerRangeValidator(int min, int max, String errorMessage)

Method Detail

atLeastback to summary
public static IntegerRangeValidator atLeast(int min, String errorMessage)

Creates an IntegerRangeValidator 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:IntegerRangeValidator

Returns a new IntegerRangeValidator.

betweenback to summary
public static IntegerRangeValidator between(int min, int max, String errorMessage)

Creates an IntegerRangeValidator 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:IntegerRangeValidator

Returns a new IntegerRangeValidator.

Exceptions
IllegalArgumentException:
Thrown if the maximum is not larger than or equal to the minimum.
exactlyback to summary
public static IntegerRangeValidator exactly(int value, String errorMessage)

Creates a IntegerRangeValidator 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:IntegerRangeValidator

Returns a new IntegerRangeValidator.

upToback to summary
public static IntegerRangeValidator upTo(int max, String errorMessage)

Creates an IntegerRangeValidator 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:IntegerRangeValidator

Returns a new IntegerRangeValidator.