com.memority.domino.shared.api.PageRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-api Show documentation
Show all versions of domino-api Show documentation
This artifact provides the API classes that are necessary to implement synchronization configuration Rules on the Memority IM platform.
/*
* Copyright (c) 2016-2023 Memority. All Rights Reserved.
*
* This file is part of Memority Domino API , a Memority project.
*
* This file is released under the Memority Public Artifacts End-User License Agreement,
* see
* Unauthorized copying of this file, via any medium is strictly prohibited.
*/
package com.memority.domino.shared.api;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
/**
* Enable to keep track of the paged search state between consecutive search iterations.
*/
@Getter
public class PageRequest {
/**
* The page index, starting with 0, incremented by 1 at each search iteration.
*/
private final int index;
/**
* An offset indicating how many elements have been retrieved so far, it is an accumulation of the search iterations.
*/
private final int offset;
/**
* An alternative to {@link #index}: an opaque token returned by the remote application enabling the application to
* keep state information between consecutive paged searches. It must be sent back to the application when searching
* the next page.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_ARRAY)
private final Object pagingToken;
/**
* The requested page size. If zero or negative, it is up to the sending implementation to choose a page size.
*/
@Setter @Accessors(chain = true)
private int size;
@JsonCreator
public PageRequest(@JsonProperty("index") int index, @JsonProperty("offset") int offset, @JsonProperty("pagingToken") Object pagingToken) {
this.index = index;
this.offset = offset;
this.pagingToken = pagingToken;
}
}