/** * Create a window using the passed in policies. * * @param <T> Tuple type. * @param <K> Key type. * @param <L> List type. * * @param insertionPolicy Policy indicating if a tuple should be inserted * into the window. * @param contentsPolicy Contents policy called prior to insertion of a tuple. * @param evictDeterminer Policy that determines action to take when * {@link Partition#evict()} is called. * @param triggerPolicy Trigger policy that is invoked after the insertion * of a tuple into a partition. * @param keyFunction Function that gets the partition key from a tuple. * @param listSupplier Supplier function for the {@code List} that holds * tuples within a partition. * @return Window using the passed in policies. */ public static <T, K, L extends List<T>> Window<T, K, L> window( BiFunction<Partition<T, K, L>, T, Boolean> insertionPolicy, BiConsumer<Partition<T, K, L>, T> contentsPolicy, Consumer<Partition<T, K, L> > evictDeterminer, BiConsumer<Partition<T, K, L>, T> triggerPolicy, Function<T, K> keyFunction, Supplier<L> listSupplier){ return new WindowImpl<>(insertionPolicy, contentsPolicy, evictDeterminer, triggerPolicy, keyFunction, listSupplier); }
/** * Create a window using the passed in policies. * * @param <T> Tuple type. * @param <K> Key type. * @param <L> List type. * * @param insertionPolicy Policy indicating if a tuple should be inserted * into the window. * @param contentsPolicy Contents policy called prior to insertion of a tuple. * @param evictDeterminer Policy that determines action to take when * {@link Partition#evict()} is called. * @param triggerPolicy Trigger policy that is invoked after the insertion * of a tuple into a partition. * @param keyFunction Function that gets the partition key from a tuple. * @param listSupplier Supplier function for the {@code List} that holds * tuples within a partition. * @return Window using the passed in policies. */ public static <T, K, L extends List<T>> Window<T, K, L> window( BiFunction<Partition<T, K, L>, T, Boolean> insertionPolicy, BiConsumer<Partition<T, K, L>, T> contentsPolicy, Consumer<Partition<T, K, L> > evictDeterminer, BiConsumer<Partition<T, K, L>, T> triggerPolicy, Function<T, K> keyFunction, Supplier<L> listSupplier){ return new WindowImpl<>(insertionPolicy, contentsPolicy, evictDeterminer, triggerPolicy, keyFunction, listSupplier); }