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(java.lang.String key,
java.lang.String locale)
Return a specific localized field.
|
java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.Object>> |
getFields() |
CMAEntry.Localized |
localize(java.lang.String locale)
Manipulate fields with the same locale.
|
CMAEntry |
setEnvironmentId(java.lang.String environmentId)
Convenience: Update the environment id, without going through
CMAResource.getSystem() . |
CMAEntry |
setField(java.lang.String key,
java.lang.String locale,
java.lang.Object value)
Creates a new field with the given
value . |
CMAEntry |
setFields(java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.Object>> fields)
Sets a map of fields for this Entry.
|
CMAEntry |
setId(java.lang.String id)
Convenience: Update the id of this entry without going through
CMAResource.getSystem() . |
CMAEntry |
setSpaceId(java.lang.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(java.lang.Integer version)
Convenience: Update the version of this entry without going through
CMAResource.getSystem() . |
java.lang.String |
toString() |
getEnvironmentId, getId, getSpaceId, getSystem, getVersion, isArchived, isPublished
public CMAEntry setSystem(CMASystem system)
setSystem
in class CMAResource
system
- sets the system property.public CMAEntry setId(java.lang.String id)
CMAResource.getSystem()
.setId
in class CMAResource
id
- to be set.public CMAEntry setVersion(java.lang.Integer version)
CMAResource.getSystem()
.setVersion
in class CMAResource
version
- to be set.public CMAEntry setSpaceId(java.lang.String spaceId)
CMAResource.getSystem()
.setSpaceId
in class CMAResource
spaceId
- to be set.public CMAEntry setEnvironmentId(java.lang.String environmentId)
CMAResource.getSystem()
.setEnvironmentId
in class CMAResource
environmentId
- to be set.public CMAEntry setField(java.lang.String key, java.lang.String locale, java.lang.Object value)
value
.
If a field named key
already exists it will be replaced.key
- field keylocale
- localevalue
- valueCMAEntry
public <T> T getField(java.lang.String key, java.lang.String locale)
T
- the type of the return valuekey
- the key of the fieldlocale
- the locale of the keypublic java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.Object>> getFields()
public CMAEntry setFields(java.util.LinkedHashMap<java.lang.String,java.util.LinkedHashMap<java.lang.String,java.lang.Object>> fields)
fields
- the fields to be setCMAEntry
instancepublic CMAEntry.Localized localize(java.lang.String locale)
locale
- the locale to be used for accessing fields.CMAEntry.Localized
to be used for setting subsequent fields.public java.lang.String toString()
toString
in class CMAResource
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.