Class ConstraintUtils

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

public class ConstraintUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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).
    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.
    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.
    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.
    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.
    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.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 validate
      fieldName - 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 validate
      fieldName - 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 validate
      fieldName - the field name used in the error message for the constraint
      min - 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 validate
      fieldName - 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 validate
      fieldName - 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 validate
      nullableProperty - the nullable property
      fieldName - 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 validate
      nullableProperty - the nullable property
      fieldName - 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 validate
      nullableProperty - the nullable property
      fieldName - 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