Class FetchThroughMetadataCacheBuilderSpec<IdentifierType,​MetadataType>

  • Type Parameters:
    IdentifierType - The metadata identifier type.
    MetadataType - the metadata type.
    All Implemented Interfaces:
    MetadataCacheBuilderSpec<IdentifierType,​MetadataType>

    public class FetchThroughMetadataCacheBuilderSpec<IdentifierType,​MetadataType>
    extends BaseMetadataCacheBuilderSpec<IdentifierType,​MetadataType>
    implements MetadataCacheBuilderSpec<IdentifierType,​MetadataType>
    A specification for building a fetch-through metadata cache.
    • Field Detail

      • fetchStrategy

        @Nullable
        private Function<CriteriaSet,​MetadataType> fetchStrategy
        The function to use to fetch metadata if either none exists, or the existing is stale.
    • Constructor Detail

      • FetchThroughMetadataCacheBuilderSpec

        protected FetchThroughMetadataCacheBuilderSpec()
        Constructor.
    • Method Detail

      • setFetchStrategy

        public void setFetchStrategy​(@Nonnull
                                     Function<CriteriaSet,​MetadataType> strategy)
        Set the metadata fetching strategy.
        Parameters:
        strategy - the strategy to use.
      • getFetchStrategy

        @Nullable
        protected Function<CriteriaSet,​MetadataType> getFetchStrategy()
        Get the metadata fetching strategy.
        Returns:
        the fetching strategy.