Class ResourceMetadataKeyEnum<T>

All Implemented Interfaces:
Direct Known Subclasses:
ResourceMetadataKeyEnum.ExtensionResourceMetadataKey, ResourceMetadataKeyEnum.ResourceMetadataKeySupportingAnyResource

public abstract class ResourceMetadataKeyEnum<T> extends Object implements Serializable
Keys in this map refer to resource metadata keys, which are keys used to access information about specific resource instances that live outside of the resource body. Typically, these are data elements which are sent/receieved in HTTP Headers along with read/create resource requests, or properties which can be found in bundle entries.

To access or set resource metadata values, every resource has a metadata map, and this class provides convenient getters/setters for interacting with that map. For example, to get a resource's UPDATED value, which is the "last updated" time for that resource, use the following code:

InstantDt updated = ResourceMetadataKeyEnum.UPDATED.get(resource);

To set this value, use the following:

InstantDt update = new InstantDt("2011-01-02T11:22:33.0000Z"); // populate with the actual time
ResourceMetadataKeyEnum.UPDATED.put(resource, update);

Note that this class is not a Java Enum, and can therefore be extended (this is why it is not actually an Enum). Users of HAPI-FHIR are able to create their own classes extending this class to define their own keys for storage in resource metadata if needed.

See Also: