Class ConfNGPropertySource


  • public class ConfNGPropertySource
    extends Object
    Spring PropertySource adapter for ConfNG.

    This class allows ConfNG to be used as a PropertySource in Spring applications, enabling seamless integration with Spring's Environment abstraction.

    Example Usage:

    {@code
    Since:
    1.1.0
    Author:
    Bharat Kumar Malviya, GitHub: github.com/imBharatMalviya
    • Constructor Detail

      • ConfNGPropertySource

        public ConfNGPropertySource​(String name,
                                    Class<E> keyClass)
        Creates a ConfNG property source with the given name and key class.
      • ConfNGPropertySource

        public ConfNGPropertySource​(String name)
        Creates a ConfNG property source that exposes all registered sources.
    • Method Detail

      • getName

        public String getName()
        Gets the name of this property source.
      • getProperty

        public Object getProperty​(String name)
        Gets a property value by name.
      • containsProperty

        public boolean containsProperty​(String name)
        Checks if this property source contains the given property.
      • getPropertyNames

        public String[] getPropertyNames()
        Gets all property names.
      • toSpringPropertySource

        public Object toSpringPropertySource()
        Creates a Spring Environment-compatible PropertySource.

        Note: This method returns an Object to avoid compile-time dependency on Spring. Cast to org.springframework.core.env.PropertySource in Spring applications.