Class Asset

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ContentItem, DigitalAsset

public abstract class Asset extends AssetLinksObject
Common base class for ContentItem and DigitalAsset.
See Also:
  • Field Details

    • id

      @SerializedName("id") @Expose protected String id
    • name

      @SerializedName("name") @Expose protected String name
    • type

      @SerializedName("type") @Expose protected String type
    • typeCategory

      @SerializedName("typeCategory") @Expose protected String typeCategory
    • description

      @SerializedName("description") @Expose protected String description
    • createdDate

      @SerializedName("createdDate") @Expose protected ContentDate createdDate
    • updatedDate

      @SerializedName("updatedDate") @Expose protected ContentDate updatedDate
    • language

      @SerializedName("language") @Expose protected String language
    • fields

      @SerializedName("fields") @Expose protected Map<String,Object> fields
  • Constructor Details

    • Asset

      public Asset()
  • Method Details

    • getTaxonomies

      public ItemList<Taxonomy> getTaxonomies()
    • getType

      public String getType()
      Get raw value of the "type" value. To interpret this value in general it is better to use getContentType()
      Returns:
      content type as a string
    • getTypeCategory

      public String getTypeCategory()
      Get raw value of the "typeCategory". To interpret this value in general it is better to use getContentType()
      Returns:
      content type category as a string
    • getContentType

      public AssetType getContentType()
      A representation of content type data which includes both "type" and "typeCategory" fields. Use methods on AssetType to determine more info.
      Returns:
      content type representation
    • getDescription

      public String getDescription()
      Get description for this item.
      Returns:
      description for item
    • getCreatedDate

      public ContentDate getCreatedDate()
      Get created date for item.
      Returns:
      Created date for item.
    • getUpdatedDate

      public ContentDate getUpdatedDate()
      Get updated date for item.
      Returns:
      Update date for item.
    • isReferenceOnly

      public boolean isReferenceOnly()
    • getId

      public String getId()
      Get the content item Id
      Returns:
      id
    • getName

      public String getName()
      Get the name of the content item
      Returns:
      name
    • getSlug

      public String getSlug()
      Get the slug for the item.
      Returns:
      item slug
    • isDigitalAsset

      public boolean isDigitalAsset()
      This method checks the type field and will return true if it is a DigitalAsset type. Another method would be check if this object is an instanceof DigitalAsset
      Returns:
      true if type field is a "DigitalAsset"
    • getFileExtension

      public String getFileExtension()
      Returns:
      file extension for digital assets or "contentItem"
    • getMimeType

      public String getMimeType()
      Returns:
      mimetype for digital assets or "contentItem"
    • getFileGroup

      public String getFileGroup()
      Returns:
      fileGroup for digital assets (e.g. "Images") or "contentItem"
    • getLanguage

      public String getLanguage()
      If applicable, a string representing the language.
      Returns:
      string for language or null if not set
    • getTranslatable

      public Boolean getTranslatable()
      Get whether the item is defined as translatable
      Returns:
      true if translatable
    • getFieldFromValue

      public ContentField getFieldFromValue(String fieldName)
      This method will "guess" the field type based on the value of the field. If you know the type of the field, you should always use getFieldFromType(String, FieldType) or the convenience methods that return specific values such as getTextField(String)
      Parameters:
      fieldName - Field name in content item.
      Returns:
      ContentField if exists, else null
    • getFieldFromType

      public <T extends ContentField> T getFieldFromType(String fieldName, FieldType type)
      A generic method that will return the content field given the specified type. For example, you could call it like this to get a the field for a content date: ContentFieldDate dateField = item.getFieldFromType("date_field", FieldType.DATE); To get the value directly for common fields, use the convenience methods below. For example, getDateField(String)
      Type Parameters:
      T - the specific ContentField class
      Parameters:
      fieldName - field name to match
      type - The type of field expected
      Returns:
      Specific ContentField derived class.
    • getDigitalAssetField

      public DigitalAsset getDigitalAssetField(String fieldName)
      Get a Digital Asset if it is contained as a field in this content item, or null if there is no matching digital asset field.
      Parameters:
      fieldName - field name to a digital asset
      Returns:
      DigitalAsset object or null if not found
    • getContentItemField

      public ContentItem getContentItemField(String fieldName)
      Get a Content Item reference if it is contained as a field in this content item, or null if there is no matching content item field.
      Parameters:
      fieldName - field name to a content item
      Returns:
      ContentItem object or null if not found
    • getBooleanField

      public Boolean getBooleanField(String fieldName)
    • getIntegerField

      public Integer getIntegerField(String fieldName)
    • getDecimalField

      public Double getDecimalField(String fieldName)
    • getTextField

      public String getTextField(String fieldName)
    • getLargeTextField

      public String getLargeTextField(String fieldName)
    • getDateField

      public ContentDate getDateField(String fieldName)
    • getJsonField

      public String getJsonField(String fieldName)
    • getReferenceListField

      public List<ContentFieldReference<Asset>> getReferenceListField(String fieldName)
    • getReferenceListIds

      public List<String> getReferenceListIds(String fieldName)