com.github.aidensuen.mongo.pagehelper.PageProcessor Maven / Gradle / Ivy
package com.github.aidensuen.mongo.pagehelper;
import com.github.aidensuen.mongo.core.MongoDaoStatement;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import java.util.List;
import java.util.Properties;
public interface PageProcessor {
/**
* Whether to skip paged and count query
*
* @param ms
* @param parameterObject
* @param pageable
* @return
*/
boolean skip(MongoDaoStatement ms, Object parameterObject, Pageable pageable);
/**
* Whether to count query
*
* @param ms
* @param parameterObject
* @param pageable
* @return
*/
boolean beforeCount(MongoDaoStatement ms, Object parameterObject, Pageable pageable);
/**
* after count query
*
* @param ms
* @param parameterObject
* @param pageable
* @return
*/
boolean afterCount(long count, MongoDaoStatement ms, Object parameterObject, Pageable pageable);
/**
* Whether to page query
*
* @param ms
* @param parameterObject
* @param pageable
* @return
*/
boolean beforePage(MongoDaoStatement ms, Object parameterObject, Pageable pageable);
/**
* get lastId
*
* @param ms
* @param parameterObject
* @param pageable
* @return
*/
Object getLastId(MongoDaoStatement ms, Object parameterObject, Pageable pageable);
/**
* get lastId direction
*
* @param ms
* @param parameterObject
* @param pageable
* @return
*/
Sort.Direction getLastIdDirection(MongoDaoStatement ms, Object parameterObject, Pageable pageable);
/**
* after to page query
*
* @param parameterObject
* @param pageable
* @return
*/
Object afterPage(List pageList, Object parameterObject, Pageable pageable);
/**
* after all proccess
*/
void afterAll();
void setProperties(Properties properties);
}