public class Config
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Config.ContentstackRegion |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
environment |
protected Config.ContentstackRegion |
region |
protected java.lang.String |
URL |
protected java.lang.String |
URLSCHEMA |
protected java.lang.String |
VERSION |
Constructor and Description |
---|
Config()
Config constructor
Example : Config config = new Config(); |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEnvironment()
Get environment.
|
java.lang.String |
getHost() |
Config.ContentstackRegion |
getRegion() |
java.lang.String |
getVersion()
Get version of the Contentstack server.
|
protected void |
setEnvironment(java.lang.String environment)
set environment.
|
void |
setHost(java.lang.String hostName)
Sets host name of the Contentstack server.
|
Config.ContentstackRegion |
setRegion(Config.ContentstackRegion region)
Sets region allow you to set your region for the Contentstack server.
|
protected java.lang.String URLSCHEMA
protected java.lang.String URL
protected java.lang.String VERSION
protected java.lang.String environment
protected Config.ContentstackRegion region
public Config()
Config config = new Config();
public Config.ContentstackRegion getRegion()
public Config.ContentstackRegion setRegion(Config.ContentstackRegion region)
region
- type Config.ContentstackRegion
Note:
Default region sets to us
Example :
config.setRegion(ContentstackRegion.US);
public void setHost(java.lang.String hostName)
hostName
- host name.
Note: Default hostname sets to cdn.contentstack.io
and default protocol is HTTPS.
Example :
config.setHost("cdn.contentstack.io");
public java.lang.String getHost()
String url = config.getHost();
public java.lang.String getVersion()
String version = config.getVersion();
protected void setEnvironment(java.lang.String environment)
environment
- uid/name
config.setEnvironment("stag", false);
public java.lang.String getEnvironment()
String environment = config.getEnvironment();