Class FallbackPredicate<T>

  • All Implemented Interfaces:
    com.google.common.base.Predicate<T>, Predicate<T>

    public class FallbackPredicate<T>
    extends Object
    implements com.google.common.base.Predicate<T>
    Predicate that wraps another predicate and can catch ClassCastException from some Comparator and degrades into casting input to an expected ExpressionType once an exception is encountered. Useful when processing data that might be mixed types, despite what the column capabilities might claim the type is, such as variant 'auto' types. This class is not thread-safe.
    • Constructor Detail

      • FallbackPredicate

        public FallbackPredicate​(com.google.common.base.Predicate<T> delegate,
                                 ExpressionType expectedType)
    • Method Detail

      • apply

        public boolean apply​(@Nullable
                             T input)
        Specified by:
        apply in interface com.google.common.base.Predicate<T>