com.smartgwt.client.data

## Interface SimpleType.SimpleTypeValueComparator

- Enclosing class:
    SimpleType

      public static interface SimpleType.SimpleTypeValueComparator

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareValues(java.lang.Object value1, java.lang.Object value2, DataSourceField field)` A custom comparator for this SimpleType.

- - ### Method Detail

    - #### compareValues

          int compareValues(java.lang.Object value1,
                            java.lang.Object value2,
                            DataSourceField field)

      A custom comparator for this SimpleType. This method will be used by the framework when it needs to compare two values of a field for equality - for example, when considering if an edited field has changed.

      Implementations of this method should return the following:

      - 0 if the two values are equal
      - -1 if the first value is greater than the second
      - 1 if the second value is greater than the first
      Parameters:
        `value1` - First value for comparison
        `value2` - Second value for comparison
        `field` - An instance of DataClass representing the field for which we are comparing values, as extra context for the comparator.
      Returns:
        -1, 0 or 1, as described above