Interface ConditionModel<C,T>

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

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

  • Method Details

    • identifier

      C identifier()
      Returns:
      the condition identifier
    • 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
    • automaticWildcard

      Note that this is only applicable to string based condition models and only used for operators Operator.EQUAL and Operator.NOT_EQUAL
      Returns:
      the Value controlling whether automatic wildcards are enabled when working with 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 state changes
    • builder

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