@@ -133,6 +133,101 @@ public int getCount() {
133
133
return count ;
134
134
}
135
135
136
+ /**
137
+ * Add param assetlibrary.
138
+ *
139
+ * @param paramKey the param key
140
+ * @param paramValue the param value
141
+ * @return the assetlibrary
142
+ *
143
+ * <br>
144
+ * <br>
145
+ * <b>Example :</b><br>
146
+ *
147
+ * <pre class="prettyprint">
148
+ * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
149
+ * AssetLibrary assetLibObject = stack.assetlibrary();
150
+ * assetLibObject.addParam();
151
+ * </pre>
152
+ */
153
+ public AssetLibrary addParam (@ NotNull String paramKey , @ NotNull Object paramValue ) {
154
+ urlQueries .put (paramKey , paramValue );
155
+ return this ;
156
+ }
157
+
158
+ /**
159
+ * Remove param key assetlibrary.
160
+ *
161
+ * @param paramKey the param key
162
+ * @return the assetlibrary
163
+ *
164
+ * <br>
165
+ * <br>
166
+ * <b>Example :</b><br>
167
+ *
168
+ * <pre class="prettyprint">
169
+ * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
170
+ * AssetLibrary assetLibObject = stack.assetlibrary();
171
+ * assetLibObject.removeParam(paramKey);
172
+ * </pre>
173
+ */
174
+ public AssetLibrary removeParam (@ NotNull String paramKey ){
175
+ if (urlQueries .has (paramKey )){
176
+ urlQueries .remove (paramKey );
177
+ }
178
+ return this ;
179
+ }
180
+
181
+
182
+
183
+ /**
184
+ * The number of objects to skip before returning any.
185
+ *
186
+ * @param number No of objects to skip from returned objects
187
+ * @return {@link Query} object, so you can chain this call.
188
+ * <p>
189
+ * <b> Note: </b> The skip parameter can be used for pagination,
190
+ * "skip" specifies the number of objects to skip in the response. <br>
191
+ *
192
+ * <br>
193
+ * <br>
194
+ * <b>Example :</b><br>
195
+ *
196
+ * <pre class="prettyprint">
197
+ * Stack stack = Contentstack.stack( "apiKey", "deliveryToken", "environment");
198
+ * AssetLibrary assetLibObject = stack.assetlibrary.skip(4);<br>
199
+ * </pre>
200
+ */
201
+
202
+ public AssetLibrary skip (@ NotNull int number ) {
203
+ urlQueries .put ("skip" ,number );
204
+ return this ;
205
+ }
206
+
207
+ /**
208
+ * A limit on the number of objects to return.
209
+ *
210
+ * @param number No of objects to limit.
211
+ * @return {@link Query} object, so you can chain this call.
212
+ * <p>
213
+ * <b> Note:</b> The limit parameter can be used for pagination, "
214
+ * limit" specifies the number of objects to limit to in the response. <br>
215
+ *
216
+ * <br>
217
+ * <br>
218
+ * <b>Example :</b><br>
219
+ *
220
+ * <pre class="prettyprint">
221
+ * Stack stack = Contentstack.stack( "apiKey", "deliveryToken", "environment");
222
+ * AssetLibrary assetLibObject = stack.assetlibrary.limit(4);<br>
223
+ * </pre>
224
+ */
225
+
226
+ public AssetLibrary limit (@ NotNull int number ) {
227
+ urlQueries .put ("limit" , number );
228
+ return this ;
229
+ }
230
+
136
231
/**
137
232
* Fetch all.
138
233
*
@@ -180,6 +275,10 @@ public void getResultObject(List<Object> objects, JSONObject jsonObject, boolean
180
275
181
276
List <Asset > assets = new ArrayList <>();
182
277
278
+ // if (objects == null || objects.isEmpty()) {
279
+ // System.out.println("Objects list is null or empty");
280
+ // }
281
+
183
282
if (objects != null && !objects .isEmpty ()) {
184
283
for (Object object : objects ) {
185
284
AssetModel model = (AssetModel ) object ;
@@ -193,7 +292,10 @@ public void getResultObject(List<Object> objects, JSONObject jsonObject, boolean
193
292
asset .setTags (model .tags );
194
293
assets .add (asset );
195
294
}
196
- }
295
+ }
296
+ // else {
297
+ // System.out.println("Object is not an instance of AssetModel");
298
+ // }
197
299
198
300
if (callback != null ) {
199
301
callback .onRequestFinish (ResponseType .NETWORK , assets );
0 commit comments