Package com.contentful.java.cma.model
Class CMALocale
- java.lang.Object
-
- com.contentful.java.cma.model.CMAResource
-
- com.contentful.java.cma.model.CMALocale
-
public class CMALocale extends CMAResource
CMALocale.This class will be used to represent a locale on the CMA SDK.
-
-
Constructor Summary
Constructors Constructor Description CMALocale()Create a new locale, specifying the type in the system property.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetCode()Get the code of this locale.java.lang.StringgetFallbackCode()java.lang.StringgetName()What is the human readable name of this locale?booleanisContentDeliveryApi()booleanisContentManagementApi()booleanisDefault()booleanisOptional()CMALocalesetCode(java.lang.String code)Set the code of the locale.CMALocalesetContentDeliveryApi(boolean contentDeliveryApi)Change this locale to be available in the content deliver api.CMALocalesetContentManagementApi(boolean contentManagementApi)Change this locale to be the used on the management api.CMALocalesetDefault(boolean isDefault)Deprecated.Setting this to default will not get send to the backend.CMALocalesetFallbackCode(java.lang.String fallbackCode)Set the fallback locale to be used once a localized field is not set in CDA.CMALocalesetId(java.lang.String id)Convenience: Update the id of this entry without going throughCMAResource.getSystem().CMALocalesetName(java.lang.String name)Change or create a human readable name of this locale.CMALocalesetOptional(boolean optional)Control whether this locale is optional.CMALocalesetSpaceId(java.lang.String spaceId)Convenience: Update the space id of this entry without going throughCMAResource.getSystem().CMALocalesetSystem(CMASystem system)Sets the system field.CMALocalesetVersion(java.lang.Integer version)Convenience: Update the version of this entry without going throughCMAResource.getSystem().java.lang.StringtoString()-
Methods inherited from class com.contentful.java.cma.model.CMAResource
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, getVisibility, isArchived, isPublished, setEnvironmentId, setVisibility
-
-
-
-
Method Detail
-
setSystem
public CMALocale setSystem(CMASystem system)
Sets the system field.- Overrides:
setSystemin classCMAResource- Parameters:
system- sets the system property.- Returns:
- this, as casted to a resource, for the ease of chaining.
-
setId
public CMALocale setId(java.lang.String id)
Convenience: Update the id of this entry without going throughCMAResource.getSystem().- Overrides:
setIdin classCMAResource- Parameters:
id- to be set.- Returns:
- the calling instance for chaining.
-
setVersion
public CMALocale setVersion(java.lang.Integer version)
Convenience: Update the version of this entry without going throughCMAResource.getSystem().- Overrides:
setVersionin classCMAResource- Parameters:
version- to be set.- Returns:
- the calling instance for chaining.
-
setSpaceId
public CMALocale setSpaceId(java.lang.String spaceId)
Convenience: Update the space id of this entry without going throughCMAResource.getSystem().- Overrides:
setSpaceIdin classCMAResource- Parameters:
spaceId- to be set.- Returns:
- the calling instance for chaining.
-
getName
public java.lang.String getName()
What is the human readable name of this locale?- Returns:
- the locale's name.
-
setName
public CMALocale setName(java.lang.String name)
Change or create a human readable name of this locale.- Parameters:
name- name of the locale to be set.- Returns:
- the instance calling this method for ease of chaining.
-
getCode
public java.lang.String getCode()
Get the code of this locale.This code will be one of IETF specification.
- Returns:
- the code of the locale.
- See Also:
- IETF
-
setCode
public CMALocale setCode(java.lang.String code)
Set the code of the locale.- Parameters:
code- IETF code to be set.- Returns:
- this instance for chaining.
- See Also:
getCode()
-
getFallbackCode
public java.lang.String getFallbackCode()
- Returns:
- the current fallback locale to be used once a localized field is not set in CDA.
-
setFallbackCode
public CMALocale setFallbackCode(java.lang.String fallbackCode)
Set the fallback locale to be used once a localized field is not set in CDA.- Parameters:
fallbackCode- an IETF code to represent the fallback.- Returns:
- this intance for ease of chaining.
-
isOptional
public boolean isOptional()
- Returns:
- true when this locale is optional, aka, can contain null fields.
-
setOptional
public CMALocale setOptional(boolean optional)
Control whether this locale is optional.- Parameters:
optional- a flag indicating optionality status of this locale.- Returns:
- this instance to ease chaining.
-
isDefault
public boolean isDefault()
- Returns:
- whether this is the default locale.
-
setDefault
@Deprecated public CMALocale setDefault(boolean isDefault)
Deprecated.Setting this to default will not get send to the backend. This method will get removed in the next major release.Change this locale to be the default, or remove this flag from it.- Parameters:
isDefault- set this to true, if you want this locale to be the default one.- Returns:
- this instance for ease of chaining.
-
isContentManagementApi
public boolean isContentManagementApi()
- Returns:
- true if this locale is used on the content management api.
-
setContentManagementApi
public CMALocale setContentManagementApi(boolean contentManagementApi)
Change this locale to be the used on the management api.- Parameters:
contentManagementApi- to update the value with.- Returns:
- this instance for ease of chaining.
-
isContentDeliveryApi
public boolean isContentDeliveryApi()
- Returns:
- true if this locale is used on the content delivery api.
-
setContentDeliveryApi
public CMALocale setContentDeliveryApi(boolean contentDeliveryApi)
Change this locale to be available in the content deliver api.- Parameters:
contentDeliveryApi- true if available.- Returns:
- this instance for ease of chaining.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classCMAResource- Returns:
- a human readable string, representing the object.
-
-