Class ReviewDbUtil


  • public class ReviewDbUtil
    extends Object
    Static utilities for ReviewDb types.
    • Method Detail

      • intKeyOrdering

        public static <K extends com.google.gwtorm.client.IntKey<?>> com.google.common.collect.Ordering<K> intKeyOrdering()
        Null-safe ordering over arbitrary subclass of IntKey.

        In some cases, Comparator.comparing(Change.Id::get) may be shorter and cleaner. However, this method may be preferable in some cases:

        • This ordering is null-safe over both input and the result of IntKey.get(); comparing is only a good idea if all inputs are obviously non-null.
        • intKeyOrdering().sortedCopy(iterable) is shorter than the stream equivalent.
        • Creating derived comparators may be more readable with Ordering method chaining rather than static Comparator methods.
      • checkColumns

        public static void checkColumns​(Class<?> clazz,
                                        Integer... expected)