Package net.solarnetwork.io
Class SimpleResourceMetadata
java.lang.Object
net.solarnetwork.io.SimpleResourceMetadata
- All Implemented Interfaces:
ResourceMetadata
Basic implementation of
ResourceMetadata.- Version:
- 1.0
- Author:
- matt
-
Field Summary
Fields inherited from interface net.solarnetwork.io.ResourceMetadata
CONTENT_TYPE_KEY, DEFAULT_CONTENT_TYPE, MODIFIED_KEY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleResourceMetadata(Date modified) Constructor.SimpleResourceMetadata(Date modified, org.springframework.util.MimeType contentType) Constructor.SimpleResourceMetadata(Date modified, org.springframework.util.MimeType contentType, Map<String, ?> extendedMetadata) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.springframework.util.MimeTypeGet the resource content type.Get the extended metadata.final DateGet the modification date, if known.voidpopulateMap(Map<String, Object> map) Populate a map with all available metadata key-value pairs.final voidputExtendedMetadata(Map<String, ?> extendedMetadata) Put a set of extended metadata.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.io.ResourceMetadata
asCustomMap, asMap, asStandardMap, isCustomKey
-
Constructor Details
-
SimpleResourceMetadata
Constructor.- Parameters:
modified- the modified date
-
SimpleResourceMetadata
Constructor.- Parameters:
modified- the modified datecontentType- the content type
-
SimpleResourceMetadata
public SimpleResourceMetadata(Date modified, org.springframework.util.MimeType contentType, Map<String, ?> extendedMetadata) Constructor.- Parameters:
modified- the modified datecontentType- the content typeextendedMetadata- optional extended metadata
-
-
Method Details
-
getModified
Description copied from interface:ResourceMetadataGet the modification date, if known.- Specified by:
getModifiedin interfaceResourceMetadata- Returns:
- the modified date, or null if not known
-
getContentType
public final org.springframework.util.MimeType getContentType()Description copied from interface:ResourceMetadataGet the resource content type.- Specified by:
getContentTypein interfaceResourceMetadata- Returns:
- the content type, never null
-
populateMap
Description copied from interface:ResourceMetadataPopulate a map with all available metadata key-value pairs.Any existing values in
mapwill be overwritten by keys from this instance.- Specified by:
populateMapin interfaceResourceMetadata- Parameters:
map- the map to populate
-
getExtendedMetadata
Get the extended metadata.- Returns:
- the extended metadata, or null if none
-
putExtendedMetadata
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
-