Interface MetadataCache

All Superinterfaces:
Serializable

@NoImplement @MinMuleVersion("4.5.0") public interface MetadataCache extends Serializable
This component provides the capability to store data so future requests for that data can be served faster and accessed from every InputTypeResolver, TypeKeysResolver and OutputTypeResolver
Since:
1.0
  • Method Details

    • put

      void put(Serializable key, Serializable value)
      Associates the specified value with the specified key in the cache. if the cache previously contained a mapping for the specified key, the old value gets replaced
      Parameters:
      key - a key to associate the specified value
      value - the value to persist in the cache
    • putAll

      void putAll(Map<? extends Serializable,? extends Serializable> values)
      Copies all of the entries from the specified map to the cache.
      Parameters:
      values - values to be stored in the cache
    • get

      <T extends Serializable> Optional<T> get(Serializable key)
      Parameters:
      key - the key whose associated value is to be returned
      Returns:
      the value to which the specified key is mapped, or Option.empty() if this map contains no value for the specified key.
    • computeIfAbsent

      <T extends Serializable> T computeIfAbsent(Serializable key, MetadataCache.MetadataCacheValueResolver mappingFunction) throws org.mule.runtime.api.metadata.MetadataResolvingException, org.mule.runtime.api.connection.ConnectionException
      If the specified key is not already associated with a value, attempts to compute its value using the given mapping function and enters it into this map unless null.
      Parameters:
      key - the key whose associated value is to be returned
      Returns:
      the current (existing or computed) value associated with the specified key, or null if the computed value is null
      Throws:
      org.mule.runtime.api.metadata.MetadataResolvingException
      org.mule.runtime.api.connection.ConnectionException