Interface ProgressTrackerStrategy<ProgressParamT>
-
- Type Parameters:
ProgressParamT- The type of the progression parameter (e.g., page number, offset, cursor)
- All Known Implementing Classes:
CursorTracker,OffsetTracker,PageTracker,ResultsPageTracker
public interface ProgressTrackerStrategy<ProgressParamT>Defines the strategy for tracking pagination state and progress. This interface abstracts away the common concerns of: 1. Parsing pagination metadata from responses 2. Determining termination conditions 3. Managing pagination stateThe tracker is responsible for: - Extracting pagination values from responses (e.g., next page number, cursor) - Determining when pagination should stop - Maintaining the current pagination state
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadvance(com.jayway.jsonpath.ReadContext respJson)Process the response and update pagination state.ProgressParamTgetPosition()Get the current progression value to use in the next request.
-
-
-
Method Detail
-
advance
boolean advance(com.jayway.jsonpath.ReadContext respJson)
Process the response and update pagination state. This method should: 1. Extract pagination metadata from the response 2. Update internal state based on the metadata 3. Return true if there are more pages to fetch, false otherwise- Parameters:
respJson- The JSON response to process- Returns:
- true if there are more pages to fetch, false otherwise
-
getPosition
ProgressParamT getPosition()
Get the current progression value to use in the next request. This value will be used to modify the request for the next page.- Returns:
- The current progression value
-
-