Interface ColumnConditionModel<C,T>

Type Parameters:
C - the type used to identify columns
T - the column value type
All Known Implementing Classes:
AbstractForeignKeyConditionModel, EntityComboBoxConditionModel, EntitySearchConditionModel

public interface ColumnConditionModel<C,T>
Specifies a condition model based on a table column, parameters, operator, upper bound and lower bound, as well as relevant events and states. For instances create a ColumnConditionModel.Builder via builder(Object, Class).
  • Field Details

  • Method Details

    • columnIdentifier

      C columnIdentifier()
      Returns:
      the column identifier
    • caseSensitive

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

      Format format()
      Returns:
      the Format object to use when formatting input, if any
    • 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
    • columnClass

      Class<T> columnClass()
      Returns:
      the column class this condition model is based on
    • setEqualValue

      void setEqualValue(T value)
      Sets the values used when the Operator.EQUAL is enabled.
      Parameters:
      value - the value to use as condition
    • getEqualValue

      T getEqualValue()
      Returns:
      the equal value, possibly null
    • setEqualValues

      void setEqualValues(Collection<T> values)
      Parameters:
      values - the values to set, an empty Collection for none
    • getEqualValues

      Collection<T> getEqualValues()
      Returns:
      the equal values, never null
    • setUpperBound

      void setUpperBound(T upper)
      Parameters:
      upper - the new upper bound
    • getUpperBound

      T getUpperBound()
      Returns:
      the upper bound
    • setLowerBound

      void setLowerBound(T value)
      Parameters:
      value - the lower bound
    • getLowerBound

      T getLowerBound()
      Returns:
      the lower bound
    • operators

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

      char wildcard()
      Returns:
      the character used as a wildcard when working with strings
    • enabled

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

      void clear()
      Disables and clears this condition model, that is, sets the upper and lower bounds to null and the operator to the default value Operator.EQUAL
    • equalValues

      ValueSet<T> equalValues()
      Returns:
      a ValueSet based on the equals values of this condition model
    • upperBoundValue

      Value<T> upperBoundValue()
      Returns:
      a Value based on the upper bound value of this condition model
    • lowerBoundValue

      Value<T> lowerBoundValue()
      Returns:
      a Value based on the lower bound value of this condition model
    • operator

      Value<Operator> operator()
      Returns:
      a Value based on the operator
    • accepts

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

      void addChangeListener(Runnable listener)
      Parameters:
      listener - a listener to be notified each time the condition state changes
    • removeChangeListener

      void removeChangeListener(Runnable listener)
      Parameters:
      listener - the listener to remove
    • builder

      static <C, T> ColumnConditionModel.Builder<C,T> builder(C columnIdentifier, Class<T> columnClass)
      Returns a new ColumnConditionModel.Builder instance.
      Type Parameters:
      C - the column identifier type
      T - the column value type
      Parameters:
      columnIdentifier - the column identifier
      columnClass - the column class
      Returns:
      a new ColumnConditionModel.Builder instance
    • caption

      static String caption(Operator operator)
      Parameters:
      operator - the operator
      Returns:
      a caption for the given operator