Package org.springframework.boot.origin
Interface Origin
- All Known Implementing Classes:
PropertySourceOrigin
,SystemEnvironmentOrigin
,TextResourceOrigin
public interface Origin
Interface that uniquely represents the origin of an item. For example, an item loaded
from a
File
may have an origin made up of the file name along with line/column
numbers.
Implementations must provide sensible hashCode()
, equals(...)
and
#toString()
implementations.
- Since:
- 2.0.0
- See Also:
-
Method Details
-
getParent
Return the parent origin for this instance if there is one. The parent origin provides the origin of the item that created this one.- Returns:
- the parent origin or
null
- Since:
- 2.4.0
- See Also:
-
from
Find theOrigin
that an object originated from. Checks if the source object is anOrigin
orOriginProvider
and also searches exception stacks.- Parameters:
source
- the source object ornull
- Returns:
- an optional
Origin
-
parentsFrom
Find the parents of theOrigin
that an object originated from. Checks if the source object is anOrigin
orOriginProvider
and also searches exception stacks. Provides a list of all parents up to rootOrigin
, starting with the most immediate parent.- Parameters:
source
- the source object ornull
- Returns:
- a list of parents or an empty list if the source is
null
, has no origin, or no parent - Since:
- 2.4.0
-