Class ConstraintUtils
java.lang.Object
cz.masci.springfx.mvci.util.constraint.ConstraintUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic io.github.palexdev.materialfx.validation.ConstraintisInAbilityScoresRange(javafx.beans.property.IntegerProperty property, String fieldName) Returns a constraint that validates whether the given IntegerProperty is within the range of 1 to 10 (inclusive).static io.github.palexdev.materialfx.validation.ConstraintisInRange(javafx.beans.property.IntegerProperty integerProperty, String fieldName, int min, int max) Returns a constraint that validates whether the given integer property is within the specified range.static io.github.palexdev.materialfx.validation.ConstraintisNotEmpty(javafx.beans.property.StringProperty stringProperty, String fieldName) Returns a constraint that validates whether the given string property is not empty.static <T> io.github.palexdev.materialfx.validation.ConstraintisNotEmptyWhenPropertyIsNotEmpty(javafx.beans.property.StringProperty stringProperty, org.reactfx.value.Var<T> nullableProperty, String fieldName) Returns a constraint that validates whether the given string property is not empty or the nullable property is empty.static io.github.palexdev.materialfx.validation.ConstraintReturns a constraint that validates whether the given string property contains only a number.static io.github.palexdev.materialfx.validation.ConstraintisNumberOrEmpty(javafx.beans.property.StringProperty stringProperty, String fieldName) Returns a constraint that validates whether the given string property contains a number or is empty.static <T> io.github.palexdev.materialfx.validation.ConstraintisNumberOrEmptyWhenPropertyIsNotEmpty(javafx.beans.property.StringProperty stringProperty, org.reactfx.value.Var<T> nullableProperty, String fieldName) Returns a constraint that validates whether the given string property contains only a number or the nullable property is empty.static <T> io.github.palexdev.materialfx.validation.ConstraintisNumberWhenPropertyIsNotEmpty(javafx.beans.property.StringProperty stringProperty, org.reactfx.value.Var<T> nullableProperty, String fieldName) Returns a constraint that validates whether the given string property contains only a number or the nullable property is empty.
-
Field Details
-
ABILITY_SCORE_MIN
public static final int ABILITY_SCORE_MIN- See Also:
-
ABILITY_SCORE_MAX
public static final int ABILITY_SCORE_MAX- See Also:
-
-
Constructor Details
-
ConstraintUtils
public ConstraintUtils()
-
-
Method Details
-
isNotEmpty
public static io.github.palexdev.materialfx.validation.Constraint isNotEmpty(javafx.beans.property.StringProperty stringProperty, String fieldName) Returns a constraint that validates whether the given string property is not empty.- Parameters:
stringProperty- the string property to validatefieldName- the field name used in error message for the constraint- Returns:
- a constraint that validates whether the given string property is not empty
-
isInAbilityScoresRange
public static io.github.palexdev.materialfx.validation.Constraint isInAbilityScoresRange(javafx.beans.property.IntegerProperty property, String fieldName) Returns a constraint that validates whether the given IntegerProperty is within the range of 1 to 10 (inclusive).- Parameters:
property- the IntegerProperty to validatefieldName- the field name used in error message for the constraint- Returns:
- a constraint that validates whether the given IntegerProperty is within the range of 1 to 10 (inclusive)
-
isInRange
public static io.github.palexdev.materialfx.validation.Constraint isInRange(javafx.beans.property.IntegerProperty integerProperty, String fieldName, int min, int max) Returns a constraint that validates whether the given integer property is within the specified range.- Parameters:
integerProperty- the integer property to validatefieldName- the field name used in the error message for the constraintmin- the minimum value of the range (inclusive)max- the maximum value of the range (inclusive)- Returns:
- a constraint that validates whether the given integer property is within the specified range
-
isNumber
public static io.github.palexdev.materialfx.validation.Constraint isNumber(javafx.beans.property.StringProperty stringProperty, String fieldName) Returns a constraint that validates whether the given string property contains only a number.- Parameters:
stringProperty- the string property to validatefieldName- the field name used in the error message for the constraint- Returns:
- a constraint that validates whether the given string property contains only a number
-
isNumberOrEmpty
public static io.github.palexdev.materialfx.validation.Constraint isNumberOrEmpty(javafx.beans.property.StringProperty stringProperty, String fieldName) Returns a constraint that validates whether the given string property contains a number or is empty.- Parameters:
stringProperty- the string property to validatefieldName- the field name used in the error message for the constraint- Returns:
- a constraint that validates whether the given string property contains only a number
-
isNotEmptyWhenPropertyIsNotEmpty
public static <T> io.github.palexdev.materialfx.validation.Constraint isNotEmptyWhenPropertyIsNotEmpty(javafx.beans.property.StringProperty stringProperty, org.reactfx.value.Var<T> nullableProperty, String fieldName) Returns a constraint that validates whether the given string property is not empty or the nullable property is empty.- Parameters:
stringProperty- the string property to validatenullableProperty- the nullable propertyfieldName- the field name used in error message for the constraint- Returns:
- a constraint that validates whether the given string property is not empty
-
isNumberWhenPropertyIsNotEmpty
public static <T> io.github.palexdev.materialfx.validation.Constraint isNumberWhenPropertyIsNotEmpty(javafx.beans.property.StringProperty stringProperty, org.reactfx.value.Var<T> nullableProperty, String fieldName) Returns a constraint that validates whether the given string property contains only a number or the nullable property is empty.- Parameters:
stringProperty- the string property to validatenullableProperty- the nullable propertyfieldName- the field name used in the error message for the constraint- Returns:
- a constraint that validates whether the given string property contains only a number
-
isNumberOrEmptyWhenPropertyIsNotEmpty
public static <T> io.github.palexdev.materialfx.validation.Constraint isNumberOrEmptyWhenPropertyIsNotEmpty(javafx.beans.property.StringProperty stringProperty, org.reactfx.value.Var<T> nullableProperty, String fieldName) Returns a constraint that validates whether the given string property contains only a number or the nullable property is empty.- Parameters:
stringProperty- the string property to validatenullableProperty- the nullable propertyfieldName- the field name used in the error message for the constraint- Returns:
- a constraint that validates whether the given string property contains only a number
-