Skip to content

Commit 5c7b850

Browse files
v1.0.0
Aug 01, 2023 - Bug Fixed For un-localize An Entry - Fixed Timeout Issue - #32 Fixed - Code coverage improvements - NRP support added - General improvements with minor breaking changes
1 parent fc362ad commit 5c7b850

File tree

6 files changed

+51
-46
lines changed

6 files changed

+51
-46
lines changed

src/main/java/com/contentstack/cms/BaseImplementation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public interface BaseImplementation {
5858
* is a String
5959
* representing the header name and the value is a String
6060
* representing the header value.
61+
* @return The method is returning an object of type T.
6162
*/
6263
<T> T addHeaders(@NotNull HashMap<String, String> headers);
6364
}

src/main/java/com/contentstack/cms/organization/Organization.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ protected Organization clearParams() {
9393
* Sets header for the request
9494
*
9595
* @param key header key for the request
96+
* @return instance of {@link Organization}
9697
*/
9798
public Organization removeParam(@NotNull String key) {
9899
this.params.remove(key);

src/main/java/com/contentstack/cms/stack/DeliveryToken.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.contentstack.cms.stack;
22

3+
import com.contentstack.cms.organization.Organization;
34
import okhttp3.ResponseBody;
45
import org.jetbrains.annotations.NotNull;
56
import org.json.simple.JSONObject;
@@ -52,9 +53,11 @@ protected DeliveryToken(TokenService service, @NotNull String tokenUid) {
5253
* @param value The value parameter is of type Object, which means it can accept
5354
* any type of object as
5455
* its value.
56+
* @return instance of {@link DeliveryToken}
5557
*/
56-
public void addHeader(@NotNull String key, @NotNull Object value) {
58+
public DeliveryToken addHeader(@NotNull String key, @NotNull Object value) {
5759
this.headers.put(key, value);
60+
return this;
5861
}
5962

6063
/**
@@ -66,6 +69,7 @@ public void addHeader(@NotNull String key, @NotNull Object value) {
6669
* @param value The value parameter is of type Object, which means it can accept
6770
* any type of object as
6871
* its value.
72+
* @return instance of {@link DeliveryToken}
6973
*/
7074
public DeliveryToken addParam(@NotNull String key, @NotNull Object value) {
7175
this.params.put(key, value);

src/main/java/com/contentstack/cms/stack/Entry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private void validateCT() {
6666
*
6767
* @param key header key for the request
6868
* @param value header value for the request
69+
* @return instance of {@link Entry}
6970
*/
7071
public Entry addHeader(@NotNull String key, @NotNull Object value) {
7172
this.headers.put(key, value);
@@ -77,6 +78,7 @@ public Entry addHeader(@NotNull String key, @NotNull Object value) {
7778
*
7879
* @param key query param key for the request
7980
* @param value query param value for the request
81+
* @return instance of {@link Entry}
8082
*/
8183
public Entry addParam(@NotNull String key, @NotNull Object value) {
8284
this.params.put(key, value);
@@ -95,6 +97,7 @@ public Entry removeParam(@NotNull String key) {
9597

9698
/**
9799
* To clear all the query params
100+
* @return instance of {@link Entry}
98101
*/
99102
protected Entry clearParams() {
100103
this.params.clear();

src/main/java/com/contentstack/cms/stack/Extensions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public Call<ResponseBody> fetch() {
157157
* <p>
158158
* <b>Example:false</b>
159159
*
160-
* @param body the request body of type Map<String, RequestBody> body
160+
* @param body the request body
161161
* @return Call
162162
* @see <a href=
163163
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#upload-a-custom-field">Upload

src/main/java/com/contentstack/cms/stack/GlobalField.java

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ void validate() {
5757
/**
5858
* Sets header for the request
5959
*
60-
* @param key
61-
* header key for the request
62-
* @param value
63-
* header value for the request
60+
* @param key header key for the request
61+
* @param value header value for the request
62+
* @return instance of {@link GlobalField}
6463
*/
6564
public GlobalField addHeader(@NotNull String key, @NotNull Object value) {
6665
this.headers.put(key, value);
@@ -70,10 +69,9 @@ public GlobalField addHeader(@NotNull String key, @NotNull Object value) {
7069
/**
7170
* Sets header for the request
7271
*
73-
* @param key
74-
* query param key for the request
75-
* @param value
76-
* query param value for the request
72+
* @param key query param key for the request
73+
* @param value query param value for the request
74+
* @return instance of {@link GlobalField}
7775
*/
7876
public GlobalField addParam(@NotNull String key, @NotNull Object value) {
7977
this.params.put(key, value);
@@ -83,8 +81,8 @@ public GlobalField addParam(@NotNull String key, @NotNull Object value) {
8381
/**
8482
* Set header for the request
8583
*
86-
* @param key
87-
* Removes query param using key of request
84+
* @param key Removes query param using key of request
85+
* @return instance of {@link GlobalField}
8886
*/
8987
public GlobalField removeParam(@NotNull String key) {
9088
this.params.remove(key);
@@ -93,6 +91,7 @@ public GlobalField removeParam(@NotNull String key) {
9391

9492
/**
9593
* To clear all the query params
94+
* @return instance of {@link GlobalField}
9695
*/
9796
protected GlobalField clearParams() {
9897
this.params.clear();
@@ -113,10 +112,10 @@ protected GlobalField clearParams() {
113112
*
114113
* @return Call
115114
* @see <a href=
116-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#environment-collection">Get
117-
* all
118-
* environments
119-
* </a>
115+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#environment-collection">Get
116+
* all
117+
* environments
118+
* </a>
120119
* @see #addHeader(String, Object) to add headers
121120
* @see #addParam(String, Object) to add query parameters
122121
* @since 0.1.0
@@ -142,10 +141,10 @@ public Call<ResponseBody> find() {
142141
*
143142
* @return Call
144143
* @see <a href=
145-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-a-single-global-field">Get
146-
* a
147-
* single global field
148-
* </a>
144+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-a-single-global-field">Get
145+
* a
146+
* single global field
147+
* </a>
149148
* @see #addHeader(String, Object) to add headers
150149
* @see #addParam(String, Object) to add query parameters
151150
* @since 0.1.0
@@ -171,15 +170,14 @@ public Call<ResponseBody> fetch() {
171170
* valid Content Management API request.
172171
* Read more about authentication.
173172
*
174-
* @param requestBody
175-
* the request body
173+
* @param requestBody the request body
176174
* @return Call
177175
* @see <a href=
178-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#create-a-global-field">Create
179-
* a global
180-
* field
176+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#create-a-global-field">Create
177+
* a global
178+
* field
181179
*
182-
* </a>
180+
* </a>
183181
* @see #addHeader(String, Object) to add headers
184182
* @since 0.1.0
185183
*/
@@ -201,15 +199,14 @@ public Call<ResponseBody> create(@NotNull JSONObject requestBody) {
201199
* valid Content Management API request.
202200
* Read more about authentication.
203201
*
204-
* @param requestBody
205-
* the request body
202+
* @param requestBody the request body
206203
* @return Call
207204
* @see <a href=
208-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#update-a-global-field">Update
209-
* a global
210-
* field
205+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#update-a-global-field">Update
206+
* a global
207+
* field
211208
*
212-
* </a>
209+
* </a>
213210
* @see #addHeader(String, Object) to add headers
214211
* @since 0.1.0
215212
*/
@@ -231,10 +228,10 @@ public Call<ResponseBody> update(@NotNull JSONObject requestBody) {
231228
*
232229
* @return Call
233230
* @see <a href=
234-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#delete-global-field">Delete
235-
* global
236-
* field
237-
* </a>
231+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#delete-global-field">Delete
232+
* global
233+
* field
234+
* </a>
238235
* @see #addHeader(String, Object) to add headers
239236
* @since 0.1.0
240237
*/
@@ -255,15 +252,14 @@ public Call<ResponseBody> delete() {
255252
* (any one is mandatory), along with the
256253
* stack API key, to make a valid Content Management API request.
257254
*
258-
* @param body
259-
* The request body
255+
* @param body The request body
260256
* @return Call
261257
* @see <a href=
262-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#import-a-global-field">Import
263-
* a global
264-
* field
258+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#import-a-global-field">Import
259+
* a global
260+
* field
265261
*
266-
* </a>
262+
* </a>
267263
* @see #addHeader(String, Object) to add headers
268264
* @since 0.1.0
269265
*/
@@ -279,11 +275,11 @@ public Call<ResponseBody> imports(@NotNull JSONObject body) {
279275
*
280276
* @return Call
281277
* @see <a href=
282-
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#export-a-global-field">Export
283-
* a global
284-
* field
278+
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#export-a-global-field">Export
279+
* a global
280+
* field
285281
*
286-
* </a>
282+
* </a>
287283
* @see #addHeader(String, Object) to add headers
288284
* @since 0.1.0
289285
*/

0 commit comments

Comments
 (0)