This repository was archived by the owner on Jul 20, 2024. It is now read-only.
forked from splunk/splunk-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollectionArgs.java
More file actions
177 lines (155 loc) · 5.16 KB
/
CollectionArgs.java
File metadata and controls
177 lines (155 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*
* Copyright 2012 Splunk, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"): you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.splunk;
/**
* The {@code CollectionArgs} class contains arguments for retrieving and
* listing entities from a collection, such as the number of entities to return
* and how to sort them.
*/
public class CollectionArgs extends Args {
/**
* Indicates whether to sort entries in ascending or descending order.
*/
public static enum SortDirection {
/** Sort entries in ascending order. */
ASC("asc"),
/** Sort entries in descending order. */
DESC("desc");
private String value;
private SortDirection(String value) {
this.value = value;
}
/**
* @return The REST API value for this enumerated constant.
*/
public String toString() {
return this.value;
}
}
/**
* Indicates the sorting mode for entries.
*/
public static enum SortMode {
/**
* If all values of the field are numbers, collate numerically.
* Otherwise, collate alphabetically.
*/
AUTO("auto"),
/** Collate alphabetically. */
ALPHA("alpha"),
/** Collate alphabetically, case-sensitive. */
ALPHA_CASE("alpha_case"),
/** Collate numerically. */
NUM("num");
private String value;
private SortMode(String value) {
this.value = value;
}
/**
* @return The REST API value for this enumerated constant.
*/
public String toString() {
return this.value;
}
}
/**
* Class constructor.
*/
public CollectionArgs() { super(); }
/* BEGIN AUTOGENERATED CODE */
/**
* Sets the app context in which to list the collection.
*
* @param app
* The app context in which to list the collection. A {@code null} value indicates no app context, and a value of {@code "-"} indicates an app wildcard.
*/
public void setApp(String app) {
this.put("app", app);
}
/**
* Sets the owner context in which to list the collection.
*
* @param owner
* The owner context in which to list the collection. A value of {@code "-"} indicates a wildcard, and a {@code null} value indicates no owner context.
*/
public void setOwner(String owner) {
this.put("owner", owner);
}
/**
* Sets the sharing context in which to list the collection.
*
* @param sharing
* The sharing context in which to list the collection. Valid values are "user", "app", "global", and "system".
*/
public void setSharing(String sharing) {
this.put("sharing", sharing);
}
/**
* Sets the maximum number of entries to return.
*
* @param count
* The maximum number of entries to return. To return all entries, specify 0.
*/
public void setCount(int count) {
this.put("count", count);
}
/**
* Sets the index of the first entry to return.
*
* @param offset
* The index of the first entry to return.
*/
public void setOffset(int offset) {
this.put("offset", offset);
}
/**
* Sets a search query to filter the response. The response matches field values against the search query. For example, "foo" matches any object that has "foo" as a substring in a field, and "field_name=field_value" restricts the match to a single field.
*
* @param search
* A search query to filter the response.
*/
public void setSearch(String search) {
this.put("search", search);
}
/**
* Sets the direction to sort entries.
*
* @param sortDirection
* The sorting order--ascending or descending.
*/
public void setSortDirection(SortDirection sortDirection) {
this.put("sort_dir", sortDirection);
}
/**
* Sets the field to use for sorting.
*
* @param sortKey
* The field to sort by.
*/
public void setSortKey(String sortKey) {
this.put("sort_key", sortKey);
}
/**
* Sets the mode to use for sorting.
*
* @param sortMode
* The collating sequence for sorting entries.
*/
public void setSortMode(SortMode sortMode) {
this.put("sort_mode", sortMode);
}
/* END AUTOGENERATED CODE */
}