/**
* Registers the specified media types and, if possible, sets last-modified
* dates and entity tags on these variants.
*/
protected void addCacheableMediaTypes(Collection<MediaType> mediaTypes) {
CacheInfo cacheInfo = getCacheInfo();
if (cacheInfo != null) {
Date lastModified = cacheInfo.getLastModified();
Tag entityTag = cacheInfo.getEntityTag();
for (MediaType mediaType : mediaTypes) {
getVariants().add(new RepresentationInfo(mediaType, lastModified, entityTag));
}
}