Package org.springframework.boot.origin
Interface OriginLookup<K>
- Type Parameters:
K
- the lookup key type
- All Known Implementing Classes:
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 lookupOrigin
information from a given key. Can be used to add origin support to existing classes.- Since:
- 2.0.0
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <K> Origin
getOrigin(Object source, K key)
Attempt to lookup the origin from the given source.Origin
getOrigin(K key)
Return the origin of the given key ornull
if the origin cannot be determined.
Method Detail
getOrigin
Origin getOrigin(K key)
Return the origin of the given key ornull
if the origin cannot be determined.- Parameters:
key
- the key to lookup- Returns:
- the origin of the key or
null
getOrigin
static <K> Origin getOrigin(Object source, K key)
Attempt to lookup the origin from the given source. If the source is not aOriginLookup
or if an exception occurs during lookup thennull
is returned.- Type Parameters:
K
- the key type- Parameters:
source
- the source objectkey
- the key to lookup- Returns:
- an
Origin
ornull