View Javadoc
1   package au.gov.amsa.risky.format;
2   
3   import rx.Observable.Transformer;
4   
5   public final class Fixes {
6   
7       public static <T extends Fix> Transformer<T, T> ignoreOutOfOrderFixes(final boolean enabled) {
8           return o -> {
9               return o.scan((a, b) -> {
10                  if (!enabled || b.time() > a.time())
11                      return b;
12                  else
13                      return a;
14              }).distinctUntilChanged();
15          };
16      }
17  
18  }