Interface OriginLookup<K>

Type Parameters:
K - the lookup key type
All Known Implementing Classes:
ConfigTreePropertySource, OriginTrackedMapPropertySource, SystemEnvironmentPropertySourceEnvironmentPostProcessor.OriginAwareSystemEnvironmentPropertySource
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface OriginLookup<K>
An interface that may be implemented by an object that can lookup Origin information from a given key. Can be used to add origin support to existing classes.
Since:
2.0.0
Author:
Phillip Webb
  • Method Summary

    Modifier and Type
    Method
    Description
    static <K> @Nullable Origin
    getOrigin(@Nullable Object source, K key)
    Attempt to look up the origin from the given source.
    @Nullable Origin
    getOrigin(K key)
    Return the origin of the given key or null if the origin cannot be determined.
  • Method Details

    • getOrigin

      @Nullable Origin getOrigin(K key)
      Return the origin of the given key or null if the origin cannot be determined.
      Parameters:
      key - the key to lookup
      Returns:
      the origin of the key or null
    • getOrigin

      static <K> @Nullable Origin getOrigin(@Nullable Object source, K key)
      Attempt to look up the origin from the given source. If the source is not a OriginLookup or if an exception occurs during lookup then null is returned.
      Type Parameters:
      K - the key type
      Parameters:
      source - the source object
      key - the key to lookup
      Returns:
      an Origin or null