public class CMAEntry extends CMAResource
| Modifier and Type | Class and Description |
|---|---|
class |
CMAEntry.Localized
Localize all fields with a given locale.
|
| Constructor and Description |
|---|
CMAEntry()
Create an entry, filling the system property
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getField(String key,
String locale)
Return a specific localized field.
|
LinkedHashMap<String,LinkedHashMap<String,Object>> |
getFields() |
CMAEntry.Localized |
localize(String locale)
Manipulate fields with the same locale.
|
CMAEntry |
setField(String key,
String locale,
Object value)
Creates a new field with the given
value. |
CMAEntry |
setFields(LinkedHashMap<String,LinkedHashMap<String,Object>> fields)
Sets a map of fields for this Entry.
|
CMAEntry |
setId(String id)
Convenience: Update the id of this entry without going through
CMAResource.getSystem(). |
CMAEntry |
setSpaceId(String spaceId)
Convenience: Update the space id of this entry without going through
CMAResource.getSystem(). |
CMAEntry |
setSystem(CMASystem system)
Sets the system field.
|
CMAEntry |
setVersion(Integer version)
Convenience: Update the version of this entry without going through
CMAResource.getSystem(). |
getId, getSpaceId, getSystem, getVersion, isArchived, isPublishedpublic CMAEntry setSystem(CMASystem system)
setSystem in class CMAResourcesystem - sets the system property.public CMAEntry setId(String id)
CMAResource.getSystem().setId in class CMAResourceid - to be set.public CMAEntry setVersion(Integer version)
CMAResource.getSystem().setVersion in class CMAResourceversion - to be set.public CMAEntry setSpaceId(String spaceId)
CMAResource.getSystem().setSpaceId in class CMAResourcespaceId - to be set.public CMAEntry setField(String key, String locale, Object value)
value.
If a field named key already exists it will be replaced.key - field keylocale - localevalue - valueCMAEntrypublic <T> T getField(String key, String locale)
T - the type of the return valuekey - the key of the fieldlocale - the locale of the keypublic LinkedHashMap<String,LinkedHashMap<String,Object>> getFields()
public CMAEntry setFields(LinkedHashMap<String,LinkedHashMap<String,Object>> fields)
fields - the fields to be setCMAEntry instancepublic CMAEntry.Localized localize(String locale)
locale - the locale to be used for accessing fields.CMAEntry.Localized to be used for setting subsequent fields.Copyright © 2017 Contentful, GmbH.. All Rights Reserved.