11package com .contentstack .sdk ;
22
3- import lombok .Getter ;
4- import lombok .Setter ;
53import okhttp3 .ConnectionPool ;
64import org .jetbrains .annotations .NotNull ;
75import org .json .JSONObject ;
@@ -23,23 +21,37 @@ public class Config {
2321 protected String version = "v3" ;
2422 protected String scheme = "https://" ;
2523 protected String endpoint ;
24+ protected String [] earlyAccess ;
2625 protected boolean enableLivePreview = false ;
2726 protected String livePreviewHost ;
2827 protected JSONObject livePreviewEntry = null ;
2928 protected ContentstackRegion region = ContentstackRegion .US ;
3029 protected String managementToken ;
31- @ Setter
32- @ Getter
3330 protected String branch ;
34- @ Setter
3531 protected Proxy proxy = null ;
3632 protected ConnectionPool connectionPool = new ConnectionPool ();
3733
3834 protected List <ContentstackPlugin > plugins = null ;
3935
36+
37+ /**
38+ * Get early access
39+ * @return array of String
40+ */
41+ public String [] getEarlyAccess () {
42+ return this .earlyAccess ;
43+ }
44+
4045 /**
41- * The configuration for the contentstack that contains support for
46+ * Get early access
47+ * @param earlyAccess type of String[]
48+ * @return instance of {@link Config}
4249 */
50+ public Config setEarlyAccess (String [] earlyAccess ) {
51+ this .earlyAccess = earlyAccess ;
52+ return this ;
53+ }
54+
4355 public String getBranch () {
4456 return branch ;
4557 }
@@ -51,20 +63,20 @@ public void setBranch(String branch) {
5163 /**
5264 * Proxy can be set like below.
5365 *
54- * @param proxy
55- * Proxy setting, typically a type (http, socks) and a socket address. A Proxy is an immutable object
56- * <br>
57- * <br>
58- * <b>Example:</b><br>
59- * <br>
60- * <code>
61- * java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", "proxyPort"));
62- * java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("sl.theproxyvpn.io", 80)); Config
63- * config = new Config(); config.setProxy(proxy);
64- * </code>
66+ * @param proxy Proxy setting, typically a type (http, socks) and a socket address. A Proxy is an immutable object
67+ * <br>
68+ * <br>
69+ * <b>Example:</b><br>
70+ * <br>
71+ * <code>
72+ * java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", "proxyPort"));
73+ * java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("sl.theproxyvpn.io", 80)); Config
74+ * config = new Config(); config.setProxy(proxy);
75+ * </code>
6576 */
66- @ Getter
67- protected String [] earlyAccess ;
77+ public void setProxy (Proxy proxy ) {
78+ this .proxy = proxy ;
79+ }
6880
6981 /**
7082 * Returns the Proxy instance
@@ -122,8 +134,13 @@ public void setPlugins(List<ContentstackPlugin> plugins) {
122134 this .plugins = plugins ;
123135 }
124136
125- public void setPlugins (List <ContentstackPlugin > plugins ) {
126- this .plugins = plugins ;
137+ /**
138+ * Gets host.
139+ *
140+ * @return the host
141+ */
142+ public String getHost () {
143+ return host ;
127144 }
128145
129146 /**
@@ -191,24 +208,4 @@ public enum ContentstackRegion {
191208 US , EU , AZURE_NA , AZURE_EU
192209 }
193210
194-
195- /**
196- * To initialize the SDK with the latest features offered in the early access phase,
197- * include the early access parameter as shown in the following code:
198- *
199- * @param earlyAccessFeatures The list of Early Access Features
200- * {@code
201- * Config config = new Config();
202- * String[] earlyAccess = {"Taxonomy", "Teams", "Terms", "LivePreview"};
203- * config.earlyAccess(earlyAccess);
204- * Stack stack = Contentstack.stack(API_KEY, DELIVERY_TOKEN, ENV, config);
205- * <p>
206- * }
207- * @return Config
208- */
209- public Config earlyAccess (@ NotNull String [] earlyAccessFeatures ) {
210- this .earlyAccess = earlyAccessFeatures ;
211- return this ;
212- }
213-
214211}
0 commit comments