Class ConditionUtils
java.lang.Object
cz.masci.springfx.mvci.util.constraint.ConditionUtils
Utility class that provides methods for checking various conditions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.beans.binding.BooleanExpressionisBlank(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is blank.static javafx.beans.binding.BooleanExpressionisEmpty(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is empty.static <T> javafx.beans.binding.BooleanExpressionisEmpty(org.reactfx.value.Val<T> value) Checks whether the givenVal<T>value is empty.static javafx.beans.binding.BooleanExpressionisInRange(javafx.beans.binding.NumberExpression value, int min, int max) Checks whether the given observable number value is in provided range<min, max>static javafx.beans.binding.BooleanExpressionisNotBlank(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is not blank.static <T> javafx.beans.binding.BooleanExpressionisNotBlankWhenPropertyIsNotEmpty(javafx.beans.value.ObservableStringValue value, javafx.beans.value.ObservableValue<T> property) Checks whether the given observable string value is not blank when the property is not empty.static javafx.beans.binding.BooleanExpressionisNotEmpty(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is not empty.static <T> javafx.beans.binding.BooleanExpressionisNotEmpty(org.reactfx.value.Val<T> value) Checks whether the givenVal<T>value is not empty.static javafx.beans.binding.BooleanExpressionisNumber(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is an integer.static javafx.beans.binding.BooleanExpressionisNumberOrBlank(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is an integer or is blank.static <T> javafx.beans.binding.BooleanExpressionisNumberOrBlankWhenPropertyIsNotEmpty(javafx.beans.value.ObservableStringValue value, javafx.beans.value.ObservableValue<T> property) Checks whether the given observable string value is a number or blank when the property is not empty.static javafx.beans.binding.BooleanExpressionisNumberOrEmpty(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is an integer or is empty.static <T> javafx.beans.binding.BooleanExpressionisNumberWhenPropertyIsNotEmpty(javafx.beans.value.ObservableStringValue value, javafx.beans.value.ObservableValue<T> property) Checks whether the given observable string value is an integer when the property is not empty.static <T,U extends io.github.palexdev.materialfx.validation.Validated>
javafx.beans.binding.BooleanExpressionisValid(javafx.beans.value.ObservableValue<T> parent, Function<T, ? extends javafx.beans.value.ObservableValue<U>> value) Determines whether the child property is valid when the parent property is set.
-
Constructor Details
-
ConditionUtils
public ConditionUtils()
-
-
Method Details
-
isEmpty
public static javafx.beans.binding.BooleanExpression isEmpty(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is empty.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isEmpty
public static <T> javafx.beans.binding.BooleanExpression isEmpty(org.reactfx.value.Val<T> value) Checks whether the givenVal<T>value is empty. It means the value is not set.- Type Parameters:
T- Type of Val value- Parameters:
value- theVal<T>value to check- Returns:
- a BooleanExpression representing the result of the check
-
isNotEmpty
public static javafx.beans.binding.BooleanExpression isNotEmpty(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is not empty.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isNotEmpty
public static <T> javafx.beans.binding.BooleanExpression isNotEmpty(org.reactfx.value.Val<T> value) Checks whether the givenVal<T>value is not empty. It means the value is set.- Type Parameters:
T- Type of Val value- Parameters:
value- theVal<T>value to check- Returns:
- a BooleanExpression representing the result of the check
-
isBlank
public static javafx.beans.binding.BooleanExpression isBlank(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is blank.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isNotBlank
public static javafx.beans.binding.BooleanExpression isNotBlank(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is not blank.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isInRange
public static javafx.beans.binding.BooleanExpression isInRange(javafx.beans.binding.NumberExpression value, int min, int max) Checks whether the given observable number value is in provided range<min, max>- Parameters:
value- the observable number value to checkmin- range lower valuemax- range top value- Returns:
- a BooleanExpression representing the result of the check
-
isNumber
public static javafx.beans.binding.BooleanExpression isNumber(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is an integer.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isNumberOrEmpty
public static javafx.beans.binding.BooleanExpression isNumberOrEmpty(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is an integer or is empty.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isNumberOrBlank
public static javafx.beans.binding.BooleanExpression isNumberOrBlank(javafx.beans.value.ObservableStringValue value) Checks whether the given observable string value is an integer or is blank.- Parameters:
value- the observable string value to check- Returns:
- a BooleanExpression representing the result of the check
-
isNotBlankWhenPropertyIsNotEmpty
public static <T> javafx.beans.binding.BooleanExpression isNotBlankWhenPropertyIsNotEmpty(javafx.beans.value.ObservableStringValue value, javafx.beans.value.ObservableValue<T> property) Checks whether the given observable string value is not blank when the property is not empty. It isTRUEwhen property is empty.- Type Parameters:
T- the type of the property value- Parameters:
value- the observable string value to checkproperty- the observable property to check- Returns:
- a BooleanExpression representing the result of the check
-
isNumberWhenPropertyIsNotEmpty
public static <T> javafx.beans.binding.BooleanExpression isNumberWhenPropertyIsNotEmpty(javafx.beans.value.ObservableStringValue value, javafx.beans.value.ObservableValue<T> property) Checks whether the given observable string value is an integer when the property is not empty. It isTRUEwhen property is empty.- Type Parameters:
T- the type of the property value- Parameters:
value- the observable string value to checkproperty- the observable property to check- Returns:
- a BooleanExpression representing the result of the check
-
isNumberOrBlankWhenPropertyIsNotEmpty
public static <T> javafx.beans.binding.BooleanExpression isNumberOrBlankWhenPropertyIsNotEmpty(javafx.beans.value.ObservableStringValue value, javafx.beans.value.ObservableValue<T> property) Checks whether the given observable string value is a number or blank when the property is not empty. It isTRUEwhen property is empty.- Type Parameters:
T- the type of the property value- Parameters:
value- the observable string value to checkproperty- the observable property to check- Returns:
- a BooleanExpression representing the result of the check
-
isValid
public static <T,U extends io.github.palexdev.materialfx.validation.Validated> javafx.beans.binding.BooleanExpression isValid(javafx.beans.value.ObservableValue<T> parent, Function<T, ? extends javafx.beans.value.ObservableValue<U>> value) Determines whether the child property is valid when the parent property is set.- Type Parameters:
T- the type of the parent property valueU- the type of the child property value- Parameters:
parent- the observable value of the parent propertyvalue- the function that maps the parent property value to the child property- Returns:
- a BooleanExpression representing the validity of the child property
-