Add 'sdk/java-v2/' from commit '55f103e336ca9fb8bf1720d2ef4ee8dd4e221118'
[arvados.git] / sdk / java-v2 / src / main / java / org / arvados / client / api / model / argument / ListArgument.java
1 /*
2  * Copyright (C) The Arvados Authors. All rights reserved.
3  *
4  * SPDX-License-Identifier: AGPL-3.0 OR Apache-2.0
5  *
6  */
7
8 package org.arvados.client.api.model.argument;
9
10 import com.fasterxml.jackson.annotation.JsonInclude;
11 import com.fasterxml.jackson.annotation.JsonProperty;
12 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
13
14 import java.util.List;
15
16 @JsonInclude(JsonInclude.Include.NON_NULL)
17 @JsonPropertyOrder({ "limit", "offset", "filters", "order", "select", "distinct", "count" })
18 public class ListArgument extends Argument {
19
20     @JsonProperty("limit")
21     private Integer limit;
22
23     @JsonProperty("offset")
24     private Integer offset;
25     
26     @JsonProperty("filters")
27     private List<Filter> filters;
28
29     @JsonProperty("order")
30     private List<String> order;
31
32     @JsonProperty("select")
33     private List<String> select;
34
35     @JsonProperty("distinct")
36     private Boolean distinct;
37
38     @JsonProperty("count")
39     private Count count;
40
41
42     ListArgument(Integer limit, Integer offset, List<Filter> filters, List<String> order, List<String> select, Boolean distinct, Count count) {
43         this.limit = limit;
44         this.offset = offset;
45         this.filters = filters;
46         this.order = order;
47         this.select = select;
48         this.distinct = distinct;
49         this.count = count;
50     }
51
52     public static ListArgumentBuilder builder() {
53         return new ListArgumentBuilder();
54     }
55
56     public enum Count {
57         
58         @JsonProperty("exact")
59         EXACT,
60         
61         @JsonProperty("none")
62         NONE
63     }
64
65     public static class ListArgumentBuilder {
66         private Integer limit;
67         private Integer offset;
68         private List<Filter> filters;
69         private List<String> order;
70         private List<String> select;
71         private Boolean distinct;
72         private Count count;
73
74         ListArgumentBuilder() {
75         }
76
77         public ListArgumentBuilder limit(Integer limit) {
78             this.limit = limit;
79             return this;
80         }
81
82         public ListArgumentBuilder offset(Integer offset) {
83             this.offset = offset;
84             return this;
85         }
86
87         public ListArgumentBuilder filters(List<Filter> filters) {
88             this.filters = filters;
89             return this;
90         }
91
92         public ListArgumentBuilder order(List<String> order) {
93             this.order = order;
94             return this;
95         }
96
97         public ListArgumentBuilder select(List<String> select) {
98             this.select = select;
99             return this;
100         }
101
102         public ListArgumentBuilder distinct(Boolean distinct) {
103             this.distinct = distinct;
104             return this;
105         }
106
107         public ListArgumentBuilder count(Count count) {
108             this.count = count;
109             return this;
110         }
111
112         public ListArgument build() {
113             return new ListArgument(limit, offset, filters, order, select, distinct, count);
114         }
115
116         public String toString() {
117             return "ListArgument.ListArgumentBuilder(limit=" + this.limit +
118                     ", offset=" + this.offset + ", filters=" + this.filters +
119                     ", order=" + this.order + ", select=" + this.select +
120                     ", distinct=" + this.distinct + ", count=" + this.count + ")";
121         }
122     }
123 }