Package com.zendesk.sdk.network.impl
Class ApplicationScope
- java.lang.Object
-
- com.zendesk.sdk.network.impl.ApplicationScope
-
public class ApplicationScope extends java.lang.Object
Representation of one configured SDK instance. Holding all the state and configurations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String
getAppId()
Gets the Zendesk Application Id asString
of the recent SDK configuration.Context
getApplicationContext()
Gets the applicationContext
of the recent application instance.java.util.List<CustomField>
getCustomFields()
Get the configured Custom Fields asList
ofCustomField
.ScopeCache<LibraryModule>
getLibraryModuleCache()
java.util.Locale
getLocale()
Get the configuredLocale
of the recent SDK configuration.java.lang.String
getOAuthToken()
Gets the Zendesk OAuth Token asString
of the recent SDK configuration.ScopeCache<RestAdapterModule>
getRestAdapterCache()
SdkOptions
getSdkOptions()
Return the configuredSdkOptions
of the recent SDK configuration.ScopeCache<StorageModule>
getStorageModuleCache()
java.lang.Long
getTicketFormId()
Get the configured Ticket Form Id asLong
of the recent SDK configuration.java.lang.String
getUrl()
Gets the Zendesk Url asString
of the recent SDK configuration.java.lang.String
getUserAgentHeader()
Get the configured User-Agent header asString
of the recent SDK configuration.boolean
isCoppaEnabled()
Return if COPPA is enabled of the recent SDK configuration.boolean
isDevelopmentMode()
Return if SDK is used in a production build or development build.com.zendesk.sdk.network.impl.ApplicationScope.Builder
newBuilder()
Returns newly createdBuilder
with the already configured options.
-
-
-
Method Detail
-
getApplicationContext
public Context getApplicationContext()
Gets the applicationContext
of the recent application instance.- Returns:
- an application
Context
-
getUrl
public java.lang.String getUrl()
Gets the Zendesk Url asString
of the recent SDK configuration.- Returns:
- the Zendesk Url as
String
-
getAppId
public java.lang.String getAppId()
Gets the Zendesk Application Id asString
of the recent SDK configuration.- Returns:
- the Zendesk Application Id as
String
-
getOAuthToken
public java.lang.String getOAuthToken()
Gets the Zendesk OAuth Token asString
of the recent SDK configuration.- Returns:
- the Zendesk OAuth Token as
String
-
getLocale
public java.util.Locale getLocale()
Get the configuredLocale
of the recent SDK configuration.
If no value was setLocale.getDefault()
will be used.- Returns:
- the used
Locale
-
isCoppaEnabled
public boolean isCoppaEnabled()
Return if COPPA is enabled of the recent SDK configuration.
If no value was set,false
will be returned.- Returns:
true
if COPPA is enabledfalse
if not
-
isDevelopmentMode
public boolean isDevelopmentMode()
Return if SDK is used in a production build or development build. There is a lot of voodoo going on, it's trying its best to detect the right stage.- Returns:
true
if SDK is used in development buildfalse
if used in production build
-
getSdkOptions
public SdkOptions getSdkOptions()
Return the configuredSdkOptions
of the recent SDK configuration.
If nothing was setDefaultSdkOptions
will be returned.- Returns:
- the configured
SdkOptions
-
getTicketFormId
public java.lang.Long getTicketFormId()
Get the configured Ticket Form Id asLong
of the recent SDK configuration.
If nothing was setnull
will be returned.- Returns:
- the configured Ticket Form Id as
Long
-
getCustomFields
public java.util.List<CustomField> getCustomFields()
Get the configured Custom Fields asList
ofCustomField
.
If nothing was configured, an emptyList
will be returned.- Returns:
- a
List
ofCustomField
-
getUserAgentHeader
public java.lang.String getUserAgentHeader()
Get the configured User-Agent header asString
of the recent SDK configuration.- Returns:
- the user-agent as a
String
-
newBuilder
public com.zendesk.sdk.network.impl.ApplicationScope.Builder newBuilder()
Returns newly createdBuilder
with the already configured options.- Returns:
- a new
Builder
-
getLibraryModuleCache
public ScopeCache<LibraryModule> getLibraryModuleCache()
-
getRestAdapterCache
public ScopeCache<RestAdapterModule> getRestAdapterCache()
-
getStorageModuleCache
public ScopeCache<StorageModule> getStorageModuleCache()
-
-