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

public Class DoubleRangeValidator

extends CustomValidator<Double>
Class Inheritance

A DoubleRangeValidator checks if a double value is between a minimum and a maximum value.
Authors
Sacha Schmid, Rinesch Murugathas

Constructor Summary

AccessConstructor and Description
private
DoubleRangeValidator(double min, double max, String errorMessage)

Method Summary

Modifier and TypeMethod and Description
public static DoubleRangeValidator

Returns:

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

Creates a DoubleRangeValidator with a given lower bound.

public static DoubleRangeValidator

Returns:

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

Creates a DoubleRangeValidator with given lower and upper bounds.

public static DoubleRangeValidator

Returns:

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

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

public static DoubleRangeValidator

Returns:

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

Creates a DoubleRangeValidator with a given upper bound.

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

Constructor Detail

DoubleRangeValidatorback to summary
private DoubleRangeValidator(double min, double max, String errorMessage)

Method Detail

atLeastback to summary
public static DoubleRangeValidator atLeast(double min, String errorMessage)

Creates a DoubleRangeValidator with a given lower bound.

Parameters
min:double

The lower bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:DoubleRangeValidator

Returns a new DoubleRangeValidator.

betweenback to summary
public static DoubleRangeValidator between(double min, double max, String errorMessage)

Creates a DoubleRangeValidator with given lower and upper bounds.

Parameters
min:double

The lower bound for the validation.

max:double

The upper bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:DoubleRangeValidator

Returns a new DoubleRangeValidator.

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

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

Parameters
value:double

The lower and upper bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:DoubleRangeValidator

Returns a new DoubleRangeValidator.

upToback to summary
public static DoubleRangeValidator upTo(double max, String errorMessage)

Creates a DoubleRangeValidator with a given upper bound.

Parameters
max:double

The upper bound for the validation.

errorMessage:String

The error message that is returned if the validation fails.

Returns:DoubleRangeValidator

Returns a new DoubleRangeValidator.