Class CMALocale


  • public class CMALocale
    extends CMAResource
    CMALocale.

    This class will be used to represent a locale on the CMA SDK.

    • Constructor Detail

      • CMALocale

        public CMALocale()
        Create a new locale, specifying the type in the system property.
    • Method Detail

      • setSystem

        public CMALocale setSystem​(CMASystem system)
        Sets the system field.
        Overrides:
        setSystem in class CMAResource
        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 through CMAResource.getSystem().
        Overrides:
        setId in class CMAResource
        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 through CMAResource.getSystem().
        Overrides:
        setVersion in class CMAResource
        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 through CMAResource.getSystem().
        Overrides:
        setSpaceId in class CMAResource
        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:
        toString in class CMAResource
        Returns:
        a human readable string, representing the object.