public class Config extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Config.ContentstackRegion |
| Modifier and Type | Field and Description |
|---|---|
protected String |
environment |
protected Config.ContentstackRegion |
region |
protected String |
URL |
protected String |
URLSCHEMA |
protected String |
VERSION |
| Constructor and Description |
|---|
Config()
Config constructor
Example : Config config = new Config(); |
| Modifier and Type | Method and Description |
|---|---|
String |
getEnvironment()
Get environment.
|
String |
getHost() |
Config.ContentstackRegion |
getRegion() |
String |
getVersion()
Get version of the Contentstack server.
|
protected void |
setEnvironment(String environment)
set environment.
|
void |
setHost(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 String URLSCHEMA
protected String URL
protected String VERSION
protected 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(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 String getHost()
String url = config.getHost();
public String getVersion()
String version = config.getVersion();
protected void setEnvironment(String environment)
environment - uid/name
config.setEnvironment("stag", false);
public String getEnvironment()
String environment = config.getEnvironment();
Copyright © 2021 Contentstack.. All rights reserved.