1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package de.kaiserpfalzedv.commons.api.resources;
19
20 import com.fasterxml.jackson.annotation.JsonIgnore;
21 import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
22 import org.eclipse.microprofile.openapi.annotations.media.Schema;
23
24 import jakarta.validation.constraints.Max;
25 import jakarta.validation.constraints.Min;
26 import jakarta.validation.constraints.NotNull;
27 import java.io.Serializable;
28
29
30
31
32
33
34
35 public interface Paging extends Serializable {
36 @JsonIgnore
37 @Schema(hidden = true)
38 @NotNull
39 Paging firstPage();
40
41 @JsonIgnore
42 @Schema(hidden = true)
43 @NotNull
44 Paging previousPage();
45
46 @JsonIgnore
47 @Schema(hidden = true)
48 @NotNull
49 Paging nextPage();
50
51 @JsonIgnore
52 @Schema(hidden = true)
53 @NotNull
54 Paging lastPage();
55
56 @Schema(description = "First element of total result set.", type = SchemaType.NUMBER, minimum = "0", maximum = "9223372036854775807", required = true)
57 @NotNull @Min(0) @Max(Long.MAX_VALUE)
58 long getStart();
59
60 @Schema(description = "Number of requested elements of the total result set.", type = SchemaType.NUMBER, minimum = "0", maximum = "9223372036854775807", required = true)
61 @NotNull @Min(0) @Max(Long.MAX_VALUE)
62 long getSize();
63
64 @Schema(description = "Count of elements in current page (may differ from size).", type = SchemaType.NUMBER, minimum = "0", maximum = "9223372036854775807", required = true)
65 @NotNull @Min(0) @Max(Long.MAX_VALUE)
66 long getCount();
67
68 @Schema(description = "Count of elements in total result set.", type = SchemaType.NUMBER, minimum = "0", maximum = "9223372036854775807", required = true)
69 @NotNull @Min(0) @Max(Long.MAX_VALUE)
70 long getTotal();
71 }