Class ConditionUtils

java.lang.Object
cz.masci.springfx.mvci.util.constraint.ConditionUtils

public class ConditionUtils extends Object
Utility class that provides methods for checking various conditions.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.beans.binding.BooleanExpression
    isBlank(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is blank.
    static javafx.beans.binding.BooleanExpression
    isEmpty(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is empty.
    static <T> javafx.beans.binding.BooleanExpression
    isEmpty(org.reactfx.value.Val<T> value)
    Checks whether the given Val<T> value is empty.
    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>
    static javafx.beans.binding.BooleanExpression
    isNotBlank(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is not blank.
    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.
    static javafx.beans.binding.BooleanExpression
    isNotEmpty(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is not empty.
    static <T> javafx.beans.binding.BooleanExpression
    isNotEmpty(org.reactfx.value.Val<T> value)
    Checks whether the given Val<T> value is not empty.
    static javafx.beans.binding.BooleanExpression
    isNumber(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is an integer.
    static javafx.beans.binding.BooleanExpression
    isNumberOrBlank(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is an integer or is blank.
    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.
    static javafx.beans.binding.BooleanExpression
    isNumberOrEmpty(javafx.beans.value.ObservableStringValue value)
    Checks whether the given observable string value is an integer or is empty.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 given Val<T> value is empty. It means the value is not set.
      Type Parameters:
      T - Type of Val value
      Parameters:
      value - the Val<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 given Val<T> value is not empty. It means the value is set.
      Type Parameters:
      T - Type of Val value
      Parameters:
      value - the Val<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 check
      min - range lower value
      max - 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 is TRUE when property is empty.
      Type Parameters:
      T - the type of the property value
      Parameters:
      value - the observable string value to check
      property - 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 is TRUE when property is empty.
      Type Parameters:
      T - the type of the property value
      Parameters:
      value - the observable string value to check
      property - 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 is TRUE when property is empty.
      Type Parameters:
      T - the type of the property value
      Parameters:
      value - the observable string value to check
      property - 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 value
      U - the type of the child property value
      Parameters:
      parent - the observable value of the parent property
      value - the function that maps the parent property value to the child property
      Returns:
      a BooleanExpression representing the validity of the child property