All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.retest.recheck.meta.MetadataProviderService Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
package de.retest.recheck.meta;

import java.util.Map;

/**
 * 

* Combines the {@link GlobalMetadataProvider} and an arbitrary local metadata provider. * *

* This allows for duplicate keys by preferring the local metadata over the global. That means that the local provider * is capable of overwriting metadata from the global provider. */ public final class MetadataProviderService implements MetadataProvider { private static final MetadataProvider GLOBAL_METADATA_PROVIDER = new GlobalMetadataProvider(); private final MetadataProvider provider; MetadataProviderService( final MetadataProvider global, final MetadataProvider local ) { provider = MultiMetadataProvider.of( global, local ); } /** * Constructs a merging provider, using the {@link GlobalMetadataProvider} and the provided local provider. The * local provider is able to overwrite keys from the global provider. * * @param localMetadataProvider * The local provider. * @return The merging provider. */ public static MetadataProvider of( final MetadataProvider localMetadataProvider ) { return new MetadataProviderService( GLOBAL_METADATA_PROVIDER, localMetadataProvider ); } @Override public Map retrieve() { return provider.retrieve(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy