Class CMAEntry


  • public class CMAEntry
    extends CMAResource
    Represents a resource of type Entry.
    • Constructor Detail

      • CMAEntry

        public CMAEntry()
        Create an entry, filling the system property
    • Method Detail

      • setSystem

        public CMAEntry setSystem​(CMASystem system)
        Sets the system field.
        Overrides:
        setSystem in class CMAResource
        Parameters:
        system - sets the system property.
        Returns:
        this, as casted to a resource, for the ease of chaining.
      • setId

        public CMAEntry setId​(java.lang.String id)
        Convenience: Update the id of this entry without going through CMAResource.getSystem().
        Overrides:
        setId in class CMAResource
        Parameters:
        id - to be set.
        Returns:
        the calling instance for chaining.
      • setVersion

        public CMAEntry setVersion​(java.lang.Integer version)
        Convenience: Update the version of this entry without going through CMAResource.getSystem().
        Overrides:
        setVersion in class CMAResource
        Parameters:
        version - to be set.
        Returns:
        the calling instance for chaining.
      • setSpaceId

        public CMAEntry setSpaceId​(java.lang.String spaceId)
        Convenience: Update the space id of this entry without going through CMAResource.getSystem().
        Overrides:
        setSpaceId in class CMAResource
        Parameters:
        spaceId - to be set.
        Returns:
        the calling instance for chaining.
      • setEnvironmentId

        public CMAEntry setEnvironmentId​(java.lang.String environmentId)
        Convenience: Update the environment id, without going through CMAResource.getSystem().
        Overrides:
        setEnvironmentId in class CMAResource
        Parameters:
        environmentId - to be set.
        Returns:
        the calling instance for chaining.
      • setField

        public CMAEntry setField​(java.lang.String key,
                                 java.lang.String locale,
                                 java.lang.Object value)
        Creates a new field with the given value. If a field named key already exists it will be replaced.
        Parameters:
        key - field key
        locale - locale
        value - value
        Returns:
        this CMAEntry
      • getField

        public <T> T getField​(java.lang.String key,
                              java.lang.String locale)
        Return a specific localized field.
        Type Parameters:
        T - the type of the return value
        Parameters:
        key - the key of the field
        locale - the locale of the key
        Returns:
        the value requested or null, if something (fields, key, locale) was not found.
      • getFields

        public java.util.LinkedHashMap<java.lang.String,​java.util.LinkedHashMap<java.lang.String,​java.lang.Object>> getFields()
        Returns:
        a map of fields for this Entry.
      • setMetadata

        public CMAEntry setMetadata​(CMAMetadata metadata)
        Sets the metadata for this entry.
        Parameters:
        metadata - The CMAMetadata instance to associate with this entry.
        Returns:
        This CMAEntry instance for method chaining.
      • setFields

        public 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.
        Parameters:
        fields - the fields to be set
        Returns:
        this CMAEntry instance
      • localize

        public CMAEntry.Localized localize​(java.lang.String locale)
        Manipulate fields with the same locale.
        Parameters:
        locale - the locale to be used for accessing fields.
        Returns:
        an instance of CMAEntry.Localized to be used for setting subsequent fields.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class CMAResource
        Returns:
        a human readable string, representing the object.