public abstract class LocalizedResource extends CDAResource
Modifier and Type | Class and Description |
---|---|
class |
LocalizedResource.Localizer |
Constructor and Description |
---|
LocalizedResource() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getField(java.lang.String key)
Get a field using the environments default locale.
|
<T> T |
getField(java.lang.String locale,
java.lang.String key)
Extracts a field from the fields set of the active locale, result type is inferred.
|
LocalizedResource.Localizer |
localize(java.lang.String locale)
Creates an object to be used for returning different field in one locale.
|
java.util.Map<java.lang.String,java.lang.Object> |
rawFields() |
void |
setField(java.lang.String locale,
java.lang.String key,
java.lang.Object value)
Internal method for updating contents of a field.
|
attrs, getAttribute, id, toString, type
public LocalizedResource.Localizer localize(java.lang.String locale)
locale
- pointing to a locale in the environment.public <T> T getField(java.lang.String key)
T
- type.key
- field key.localize(String)
public <T> T getField(java.lang.String locale, java.lang.String key)
T
- type.locale
- locale to be used.key
- field key.public void setField(java.lang.String locale, java.lang.String key, java.lang.Object value)
This method is used by the SDK to generate objects based on raw fields. Do not use this field to update data on Contentful. Take a look at the CMA-SDK for that.
locale
- locale to be updated.key
- the key of the field to be updated.value
- the value of the field to be used.public java.util.Map<java.lang.String,java.lang.Object> rawFields()
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.