Interface ConditionModel<T>

Type Parameters:
T - the condition value type
All Known Implementing Classes:
ForeignKeyConditionModel, SwingForeignKeyConditionModel

public interface ConditionModel<T>
Specifies a condition with an operator and operands as well as relevant events and states. For instances create a ConditionModel.Builder via builder(Class).
  • Field Details

  • Method Details

    • caseSensitive

      State caseSensitive()
      Returns:
      the State controlling whether this model is case-sensitive, when working with strings
    • format

      Optional<Format> format()
      Returns:
      the Format object to use when formatting input, an empty Optional in case none is available
    • dateTimePattern

      String dateTimePattern()
      Returns:
      the date/time format pattern, if any
    • wildcard

      Note that this is only applicable to string based condition models and only used for operators Operator.EQUAL and Operator.NOT_EQUAL
      Returns:
      the Mutable controlling whether wildcards are added to strings
    • autoEnable

      State autoEnable()
      Returns:
      the State controlling whether this model is enabled automatically when a condition value is specified
    • locked

      State locked()
      Returns:
      the State controlling the locked status
    • valueClass

      Class<T> valueClass()
      Returns:
      the value class this condition model is based on
    • operators

      List<Operator> operators()
      Returns:
      the operators available in this condition model
    • enabled

      State enabled()
      Returns:
      a state controlling the enabled status
    • clear

      void clear()
      Clears this condition model, that is, clears all operands and sets the operator to the initial one.
      See Also:
    • operator

      Value<Operator> operator()
      Returns:
      a Value controlling on the operator
    • operands

      Returns:
      the operands
    • accepts

      boolean accepts(Comparable<T> value)
      Returns true if the given value is accepted by this models condition.
      Parameters:
      value - the value
      Returns:
      true if the given value is accepted by this models condition
    • changed

      Observer<?> changed()
      Returns:
      an observer notified each time the condition changes
    • builder

      static <T> ConditionModel.Builder<T> builder(Class<T> valueClass)
      Returns a new ConditionModel.Builder instance.
      Type Parameters:
      T - the condition value type
      Parameters:
      valueClass - the value class
      Returns:
      a new ConditionModel.Builder instance