Interface ConfigurationPropertyJSONGenerator

  • All Superinterfaces:
    java.lang.Comparable<Prioritized>, Prioritized
    All Known Implementing Classes:
    DefaultConfigurationPropertyJSONGenerator, ReflectiveConfigurationPropertyJSONGenerator

    public interface ConfigurationPropertyJSONGenerator
    extends Prioritized
    ConfigurationPropertyJSONGenerator is an interface that defines the contract for generating JSON representations of ConfigurationProperty objects.

    Implementations of this interface are responsible for converting a ConfigurationProperty into a JSON string. This can be useful for serialization, logging, or transmitting configuration metadata in a standardized format.

    Example Usage

     
     ConfigurationProperty property = new ConfigurationProperty("server.port", "8080", "The port number");
     ConfigurationPropertyJSONGenerator generator = new SomeConcreteGenerator();
     String json = generator.generate(property);
     // json might look like: {"name":"server.port","value":"8080","description":"The port number"}
     
     
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    ConfigurationProperty
    • Method Detail

      • generate

        @Nonnull
        java.lang.String generate​(ConfigurationProperty configurationProperty)
                           throws java.lang.IllegalArgumentException
        Generates a JSON representation of the given ConfigurationProperty.
        Parameters:
        configurationProperty - the configuration property to be converted to JSON.
        Returns:
        a JSON string representation of the configuration property.
        Throws:
        java.lang.IllegalArgumentException - if the configurationProperty is null.