public static class CMAAsset.Fields
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
CMAAsset.Fields.Localized
Localize all fields with a given locale.
|
Constructor and Description |
---|
Fields() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription(java.lang.String locale)
Retrieve the description to the given locale.
|
CMAAssetFile |
getFile(java.lang.String locale)
Return the localized file of this asset.
|
java.lang.String |
getTitle(java.lang.String locale)
What is the title of this asset in a given locale?
|
CMAAsset.Fields.Localized |
localize(java.lang.String locale)
Localize access to fields by the same locale.
|
CMAAsset.Fields |
setDescription(java.lang.String locale,
java.lang.String description)
Set the description in a specific locale.
|
CMAAsset.Fields |
setFile(java.lang.String locale,
CMAAssetFile file)
Update or create a new file for this asset.
|
CMAAsset.Fields |
setTitle(java.lang.String locale,
java.lang.String title)
Update or set title in a given locale.
|
java.lang.String |
toString()
For debugging, it returns only the en-US locales!
|
java.lang.String |
toString(java.lang.String locale) |
public java.lang.String getDescription(java.lang.String locale)
locale
- which locale should the description be in?public CMAAsset.Fields setDescription(java.lang.String locale, java.lang.String description)
locale
- the locale to be used. Think 'en-US'.description
- the text of the description, localized into the locale.CMAAsset.Fields
instance calling, used for chaining.public java.lang.String getTitle(java.lang.String locale)
locale
- the locale to check for a titlepublic CMAAsset.Fields setTitle(java.lang.String locale, java.lang.String title)
If a title in the given locale is present, update it, otherwise create a new one.
locale
- which locale to be used.title
- the title corresponding to this locale.CMAAsset.Fields
instance used to calling other setters for chaining.public CMAAssetFile getFile(java.lang.String locale)
Returns CMAAssetFile
for the given locale.
locale
- which locale should be used to select the right file?public CMAAsset.Fields setFile(java.lang.String locale, CMAAssetFile file)
locale
- which locale to be used?file
- the actual file to be set.public CMAAsset.Fields.Localized localize(java.lang.String locale)
Use this to not keep repeating the same locale for fields.
locale
- a code of a locale. Think `en-US`.public java.lang.String toString(java.lang.String locale)
locale
- the locale to be used for converting.public java.lang.String toString()
toString
in class java.lang.Object
toString(String)
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.