public abstract class PropertySource<T>
Abstract base class representing a source of name/value property pairs. The underlying
source object may be of any type T that encapsulates
properties. Examples include Properties objects, Map
objects, ServletContext and ServletConfig objects (for access to init
parameters). Explore the PropertySource type hierarchy to see provided
PropertySource objects are not typically used in isolation, but rather
through a PropertySources object, which aggregates property sources and in
conjunction with a PropertyResolver implementation that can perform
precedence-based searches across the set of PropertySources.
PropertySource identity is determined not based on the content of
encapsulated properties, but rather based on the name of the
PropertySource alone. This is useful for manipulating PropertySource
objects when in collection contexts. See operations in MutablePropertySources
as well as the named(String) and toString() methods for details.
Note that when working with @Configuration classes that
annotation provides a convenient and declarative way of adding property sources to the
This PropertySource object is equal to the given object if:
they are the same instance
the name properties for both objects are equal
No properties other than name are evaluated.
equals in class java.lang.Object
public int hashCode()
Return a hash code derived from the name property
of this PropertySource object.
hashCode in class java.lang.Object
public java.lang.String toString()
Produce concise output (type and name) if the current log level does not include
debug. If debug is enabled, produce verbose output including the hash code of the
PropertySource instance and every name/value property pair.
This variable verbosity is useful as a property source such as system properties
or environment variables may contain an arbitrary number of property pairs,
potentially leading to difficult to read exception and log messages.