public static Metadata applyVersion ( Metadata source , Metadata target ) { if ( target . version ( ) == null && source . version ( ) != null ) return target . builder ( ) . version ( source . version ( ) ) . build ( ) ; return 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 .