Package net.solarnetwork.io
Interface ResourceMetadata
- All Known Implementing Classes:
SimpleResourceMetadata
public interface ResourceMetadata
Metadata about a resource.
- Since:
- 1.54
- Version:
- 1.0
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe metadata map key for thegetModified()value.static final org.springframework.util.MimeTypeThe default content type value.static final StringThe metadata map key for thegetModified()value. -
Method Summary
Modifier and TypeMethodDescriptionGet the metadata as a map of key-value pairs, excluding any standard metadata properties so that only custom metadata values are included.asMap()Get the metadata as a map of key-value pairs.Get the metadata as a map of key-value pairs, excluding any custom metadata properties so that only standard metadata values are included.default org.springframework.util.MimeTypeGet the resource content type.Get the modification date, if known.default booleanisCustomKey(String key) Test if a metadata map key is standard or custom.default voidpopulateMap(Map<String, Object> map) Populate a map with all available metadata key-value pairs.
-
Field Details
-
DEFAULT_CONTENT_TYPE
static final org.springframework.util.MimeType DEFAULT_CONTENT_TYPEThe default content type value. -
CONTENT_TYPE_KEY
The metadata map key for thegetModified()value.- See Also:
-
MODIFIED_KEY
The metadata map key for thegetModified()value.- See Also:
-
-
Method Details
-
getModified
Date getModified()Get the modification date, if known.- Returns:
- the modified date, or null if not known
-
getContentType
default org.springframework.util.MimeType getContentType()Get the resource content type.- Returns:
- the content type, never null
-
asMap
Get the metadata as a map of key-value pairs.Implementing classes are free to return a map with arbitrary keys.
- Returns:
- a map of the metadata values
-
populateMap
Populate a map with all available metadata key-value pairs.Any existing values in
mapwill be overwritten by keys from this instance.- Parameters:
map- the map to populate
-
asStandardMap
Get the metadata as a map of key-value pairs, excluding any custom metadata properties so that only standard metadata values are included.- Returns:
- a map of the standard metadata values
-
asCustomMap
Get the metadata as a map of key-value pairs, excluding any standard metadata properties so that only custom metadata values are included.- Returns:
- a map of the custom metadata values
-
isCustomKey
Test if a metadata map key is standard or custom.- Parameters:
key- the metadata key to test- Returns:
- true if
keyrepresents a custom metadata key, false if it represents a standard metadata key
-