public class CMAEntry extends CMAResource
| Modifier and Type | Class and Description |
|---|---|
class |
CMAEntry.Localized
Localize all fields with a given locale.
|
| Modifier and Type | Field and Description |
|---|---|
CMAMetadata |
metadata |
| 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() |
CMAMetadata |
getMetadata() |
CMAEntry.Localized |
localize(String locale)
Manipulate fields with the same locale.
|
CMAEntry |
setEnvironmentId(String environmentId)
Convenience: Update the environment id, without going through
CMAResource.getSystem(). |
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 |
setMetadata(CMAMetadata metadata)
Sets the metadata for this entry.
|
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(). |
String |
toString() |
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, getVisibility, isArchived, isPublished, setVisibilitypublic CMAMetadata metadata
public 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 setEnvironmentId(String environmentId)
CMAResource.getSystem().setEnvironmentId in class CMAResourceenvironmentId - 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 CMAMetadata getMetadata()
public CMAEntry setMetadata(CMAMetadata metadata)
metadata - The CMAMetadata instance to associate with this entry.CMAEntry instance for method chaining.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.public String toString()
toString in class CMAResourceCopyright © 2026 Contentful, GmbH.. All rights reserved.