Package org.infinispan.metadata
Class Metadatas
java.lang.Object
org.infinispan.metadata.Metadatas
Utility method for Metadata classes.
- Since:
- 5.3
- Author:
- Galder ZamarreƱo
-
Method Summary
Modifier and TypeMethodDescriptionstatic Metadata
applyVersion
(Metadata source, Metadata target) Applies version in source metadata to target metadata, if no version in target metadata.static void
updateMetadata
(CacheEntry entry, Metadata providedMetadata) Set theprovidedMetadata
on the cache entry.
-
Method Details
-
applyVersion
Applies version in source metadata to target metadata, if no version in target metadata. This method can be useful in scenarios where source version information must be kept around, i.e. write skew, or when reading metadata from cache store.- Parameters:
source
- Metadata object which is source, whose version might be is of interest for the target metadatatarget
- Metadata object on which version might be applied- Returns:
- either, the target Metadata instance as it was when it was called, or a brand new target Metadata instance with version from source metadata applied.
-
updateMetadata
Set theprovidedMetadata
on the cache entry. If the entry already has a version, copy the version in the new metadata.
-