Class Metadatas


  • public class Metadatas
    extends java.lang.Object
    Utility method for Metadata classes.
    Since:
    5.3
    Author:
    Galder ZamarreƱo
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static 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 the providedMetadata on the cache entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • applyVersion

        public static Metadata applyVersion​(Metadata source,
                                            Metadata target)
        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 metadata
        target - 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

        public static void updateMetadata​(CacheEntry entry,
                                          Metadata providedMetadata)
        Set the providedMetadata on the cache entry. If the entry already has a version, copy the version in the new metadata.