Class OriginTrackedMapPropertySource

java.lang.Object
org.springframework.core.env.PropertySource<T>
org.springframework.core.env.EnumerablePropertySource<Map<String,Object>>
org.springframework.core.env.MapPropertySource
org.springframework.boot.env.OriginTrackedMapPropertySource
All Implemented Interfaces:
OriginLookup<String>

public final class OriginTrackedMapPropertySource extends org.springframework.core.env.MapPropertySource implements OriginLookup<String>
OriginLookup backed by a Map containing OriginTrackedValues.
Since:
2.0.0
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource

    org.springframework.core.env.PropertySource.StubPropertySource
  • Field Summary

    Fields inherited from class org.springframework.core.env.PropertySource

    logger, name, source
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new OriginTrackedMapPropertySource instance.
    OriginTrackedMapPropertySource(String name, Map source, boolean immutable)
    Create a new OriginTrackedMapPropertySource instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the origin of the given key or null if the origin cannot be determined.
     
    boolean
    Return true if this lookup is immutable and has contents that will never change.

    Methods inherited from class org.springframework.core.env.MapPropertySource

    containsProperty, getPropertyNames

    Methods inherited from class org.springframework.core.env.PropertySource

    equals, getName, getSource, hashCode, named, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.boot.origin.OriginLookup

    getPrefix
  • Constructor Details

    • OriginTrackedMapPropertySource

      public OriginTrackedMapPropertySource(String name, Map source)
      Create a new OriginTrackedMapPropertySource instance.
      Parameters:
      name - the property source name
      source - the underlying map source
    • OriginTrackedMapPropertySource

      public OriginTrackedMapPropertySource(String name, Map source, boolean immutable)
      Create a new OriginTrackedMapPropertySource instance.
      Parameters:
      name - the property source name
      source - the underlying map source
      immutable - if the underlying source is immutable and guaranteed not to change
      Since:
      2.2.0
  • Method Details

    • getProperty

      public Object getProperty(String name)
      Overrides:
      getProperty in class org.springframework.core.env.MapPropertySource
    • getOrigin

      public Origin getOrigin(String name)
      Description copied from interface: OriginLookup
      Return the origin of the given key or null if the origin cannot be determined.
      Specified by:
      getOrigin in interface OriginLookup<String>
      Parameters:
      name - the key to lookup
      Returns:
      the origin of the key or null
    • isImmutable

      public boolean isImmutable()
      Description copied from interface: OriginLookup
      Return true if this lookup is immutable and has contents that will never change.
      Specified by:
      isImmutable in interface OriginLookup<String>
      Returns:
      if the lookup is immutable