Package org.apache.camel.support.resume
Class Resumables
- java.lang.Object
-
- org.apache.camel.support.resume.Resumables
-
public final class Resumables extends Object
A wrapper for resumable entities
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
org.apache.camel.resume.Resumableof(K addressable, V offset)
Creates a new resumable for an addressablestatic <T> T[]
resumeEach(T[] input, Predicate<T> resumableCheck)
Iterates over the set of input checking if they should be resumed or not.
-
-
-
Method Detail
-
of
public static <K,V> org.apache.camel.resume.Resumable of(K addressable, V offset)
Creates a new resumable for an addressable- Type Parameters:
K
- the type of the key, name or object that can be addressed by the given offset (aka addressable)V
- the type of offset- Parameters:
addressable
- the key, name or object that can be addressed by the given offsetoffset
- the offset value- Returns:
- A new resumable entity for the given addressable with the given offset value
-
resumeEach
public static <T> T[] resumeEach(T[] input, Predicate<T> resumableCheck)
Iterates over the set of input checking if they should be resumed or not.- Parameters:
input
- the input array to check for resumablesresumableCheck
- a checker method that returns true if a single entry of the input should be resumed or false otherwise. For instance: given a set A, B and C, where B has already been processed, then a test for A and C returns true, whereas a test for B returns false.- Returns:
- a new array containing the elements that still need to be processed
-
-