Class SimpleResourceMetadata

java.lang.Object
net.solarnetwork.io.SimpleResourceMetadata
All Implemented Interfaces:
ResourceMetadata

public class SimpleResourceMetadata extends Object implements ResourceMetadata
Basic implementation of ResourceMetadata.
Version:
1.0
Author:
matt
  • Constructor Details

    • SimpleResourceMetadata

      public SimpleResourceMetadata(Date modified)
      Constructor.
      Parameters:
      modified - the modified date
    • SimpleResourceMetadata

      public SimpleResourceMetadata(Date modified, org.springframework.util.MimeType contentType)
      Constructor.
      Parameters:
      modified - the modified date
      contentType - the content type
    • SimpleResourceMetadata

      public SimpleResourceMetadata(Date modified, org.springframework.util.MimeType contentType, Map<String,?> extendedMetadata)
      Constructor.
      Parameters:
      modified - the modified date
      contentType - the content type
      extendedMetadata - optional extended metadata
  • Method Details

    • getModified

      public final Date getModified()
      Description copied from interface: ResourceMetadata
      Get the modification date, if known.
      Specified by:
      getModified in interface ResourceMetadata
      Returns:
      the modified date, or null if not known
    • getContentType

      public final org.springframework.util.MimeType getContentType()
      Description copied from interface: ResourceMetadata
      Get the resource content type.
      Specified by:
      getContentType in interface ResourceMetadata
      Returns:
      the content type, never null
    • populateMap

      public void populateMap(Map<String,Object> map)
      Description copied from interface: ResourceMetadata
      Populate a map with all available metadata key-value pairs.

      Any existing values in map will be overwritten by keys from this instance.

      Specified by:
      populateMap in interface ResourceMetadata
      Parameters:
      map - the map to populate
    • getExtendedMetadata

      public final Map<String,Object> getExtendedMetadata()
      Get the extended metadata.
      Returns:
      the extended metadata, or null if none
    • putExtendedMetadata

      public final void putExtendedMetadata(Map<String,?> extendedMetadata)
      Put a set of extended metadata.

      This will overwrite any existing keys already present in the extended metadata.

      Parameters:
      extendedMetadata - the extended metadata to add