diff --git a/pom.xml b/pom.xml index 95eb28ea..73e00663 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.contentstack.sdk java - 1.12.0-SNAPSHOT + 1.12.1-SNAPSHOT jar contentstack-java Java SDK for Contentstack Content Delivery API @@ -19,13 +19,13 @@ 2.22.0 2.2.1 3.4.1 - 2.3.2 + 3.0.0 3.1.6 2.9.0 2.9.0 - 4.10.0 + 4.11.0 0.8.5 - 1.18.26 + 1.18.28 5.9.2 5.8.0-M1 2.8.8 @@ -37,7 +37,7 @@ 20230227 0.8.7 2.5.3 - 1.2.0 + 1.2.2 diff --git a/src/main/java/com/contentstack/sdk/Config.java b/src/main/java/com/contentstack/sdk/Config.java index 656057b7..fd736a6d 100644 --- a/src/main/java/com/contentstack/sdk/Config.java +++ b/src/main/java/com/contentstack/sdk/Config.java @@ -78,7 +78,7 @@ public Proxy getProxy() { * @param keepAliveDuration * the keepAliveDuration default value is 5 * @param timeUnit - * the timeUnit default value is TimeUnit.MINUTES + * the timeUnit default value is TimeUnit. MINUTES * @return ConnectionPool */ public ConnectionPool connectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit) { diff --git a/src/main/java/com/contentstack/sdk/Constants.java b/src/main/java/com/contentstack/sdk/Constants.java index fb5dde3e..a6500e1e 100644 --- a/src/main/java/com/contentstack/sdk/Constants.java +++ b/src/main/java/com/contentstack/sdk/Constants.java @@ -21,7 +21,7 @@ public class Constants { private static final Logger logger = Logger.getLogger(Constants.class.getSimpleName()); - protected static final String SDK_VERSION = "1.11.0"; + protected static final String SDK_VERSION = "1.12.1"; protected static final String ENVIRONMENT = "environment"; protected static final String CONTENT_TYPE_UID = "content_type_uid"; protected static final String ENTRY_UID = "entry_uid"; @@ -71,9 +71,9 @@ public enum REQUEST_CONTROLLER { /** * @param dateString - * the date in string format + * the date in string format * @param zoneId - * the string zoneId + * the string zoneId * @return Calendar */ public static Calendar parseDateToTimeZone(@NotNull String dateString, @NotNull String zoneId) { @@ -99,10 +99,9 @@ private static Calendar toCalendar(@NotNull String date) { /** * @param date - * The date in string format like (String dateString = - * "2016-12-16T12:36:33.961Z";) + * The date in string format like (String dateString = "2016-12-16T12:36:33.961Z";) * @param timeZone - * the time zone as string + * the time zone as string * @return calendar @{@link Calendar} */ public static Calendar parseDate(@NotNull String date, TimeZone timeZone) { diff --git a/src/main/java/com/contentstack/sdk/Entry.java b/src/main/java/com/contentstack/sdk/Entry.java index 4dc93206..bb5faf3b 100644 --- a/src/main/java/com/contentstack/sdk/Entry.java +++ b/src/main/java/com/contentstack/sdk/Entry.java @@ -80,7 +80,7 @@ public Entry configure(JSONObject jsonObject) { * Example :
* *
-     *                                                         
+ * */ public void setHeader(String key, String value) { @@ -98,10 +98,10 @@ public void setHeader(String key, String value) { * Example :
* *
-     *                                         Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
-     *                                         Entry entry = stack.contentType("form_name").entry("entry_uid");
-     *                                         entry.removeHeader("custom_header_key");
-     *                                         
+ * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); + * Entry entry = stack.contentType("form_name").entry("entry_uid"); + * entry.removeHeader("custom_header_key"); + * */ public void removeHeader(String key) { @@ -244,8 +244,8 @@ public JSONObject toJSON() { * Example :
* *
-     *                                                                                                                                                                                                                                    Object obj = entry.get("key");
-     *                                                                                                                                                                                                                                    
+ * Object obj = entry.get("key"); + * * @return Object @resultJson */ public Object get(@NotNull String key) { @@ -261,8 +261,8 @@ public Object get(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    String value = entry.getString("key");
-     *                                                                                                                                                                                                                                    
+ * String value = entry.getString("key"); + * * @return String @getString */ @@ -283,8 +283,8 @@ public String getString(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    Boolean value = entry.getBoolean("key");
-     *                                                                                                                                                                                                                                    
+ * Boolean value = entry.getBoolean("key"); + * * @return boolean @getBoolean */ @@ -305,8 +305,8 @@ public Boolean getBoolean(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    JSONArray value = entry.getJSONArray("key");
-     *                                                                                                                                                                                                                                    
+ * JSONArray value = entry.getJSONArray("key"); + * * @return JSONArray @getJSONArray */ @@ -327,8 +327,8 @@ public JSONArray getJSONArray(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    JSONObject value = entry.getJSONObject("key");
-     *                                                                                                                                                                                                                                    
+ * JSONObject value = entry.getJSONObject("key"); + * * @return JSONObject @getJSONObject */ public JSONObject getJSONObject(@NotNull String key) { @@ -348,8 +348,8 @@ public JSONObject getJSONObject(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    JSONObject value = entry.getJSONObject("key");
-     *                                                                                                                                                                                                                                    
+ * JSONObject value = entry.getJSONObject("key"); + * * @return Number @getNumber */ @@ -370,8 +370,8 @@ public Number getNumber(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    int value = entry.getInt("key");
-     *                                                                                                                                                                                                                                    
+ * int value = entry.getInt("key"); + * * @return int @getInt */ @@ -436,8 +436,8 @@ public double getDouble(@NotNull String key) { * Example :
* *
-     *                                                 long value = entry.getLong("key");
-     *                                                 
+ * long value = entry.getLong("key"); + * * @return long @getLong */ @@ -460,8 +460,8 @@ public long getLong(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    short value = entry.getShort("key");
-     *                                                                                                                                                                                                                                    
+ * short value = entry.getShort("key"); + * * @return short @getShort */ public short getShort(@NotNull String key) { @@ -481,8 +481,8 @@ public short getShort(@NotNull String key) { * Example :
* *
-     *                                                                                                                                                                                                                                    Calendar value = entry.getDate("key");
-     *                                                                                                                                                                                                                                    
+ * Calendar value = entry.getDate("key"); + * * @return Calendar @getDate */ @@ -664,9 +664,9 @@ public List getAssets(String key) { * Example :
* *
-     *                                                                                                                                                                                                                                     Group innerGroup = entry.getGroup("key");
-     *                                                                                                                                                                                                                                     return null
-     *                                                                                                                                                                                                                                    
+ * Group innerGroup = entry.getGroup("key"); + * return null + * * @return {@link Group} */ public Group getGroup(String key) { @@ -892,18 +892,17 @@ public Entry exceptWithReferenceUid(@NotNull List fieldUid, @NotNull Str * Example :
* *
-     *                                                                                          {@code
-     *                                                                                          Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
-     *                                                                                          Entry entry = stack.contentType("form_name").entry("entry_uid");
- * entry.fetch(new EntryResultCallBack() {
- * @Override - * public void onCompletion(ResponseType responseType, Error error) { - * }
- * });
- * } - *
+ * {@code + * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); + * Entry entry = stack.contentType("form_name").entry("entry_uid");
+ * entry.fetch(new EntryResultCallBack() {
+ * @Override + * public void onCompletion(ResponseType responseType, Error error) { + * }
+ * });
+ * } + * */ - public void fetch(EntryResultCallBack callback) { if (uid.isEmpty()) { // throws IllegalAccessException if uid is Empty try { @@ -920,16 +919,14 @@ public void fetch(EntryResultCallBack callback) { private void fetchFromNetwork(String urlString, JSONObject urlQueries, EntryResultCallBack callBack) { - try { - JSONObject mainJson = new JSONObject(); - setIncludeJSON(urlQueries, callBack); - mainJson.put("query", urlQueries); - HashMap urlParams = getUrlParams(mainJson); - new CSBackgroundTask(this, contentType.stackInstance, Constants.FETCHENTRY, urlString, this.headers, - urlParams, Constants.REQUEST_CONTROLLER.ENTRY.toString(), callBack); - } catch (Exception e) { - throwException(null, e, callBack); - } + + JSONObject mainJson = new JSONObject(); + setIncludeJSON(urlQueries, callBack); + mainJson.put("query", urlQueries); + HashMap urlParams = getUrlParams(mainJson); + new CSBackgroundTask(this, contentType.stackInstance, Constants.FETCHENTRY, urlString, this.headers, + urlParams, Constants.REQUEST_CONTROLLER.ENTRY.toString(), callBack); + }