Package io.microsphere.metadata
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 ofConfigurationProperty
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
-
-
Field Summary
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
generate(ConfigurationProperty configurationProperty)
Generates a JSON representation of the givenConfigurationProperty
.-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo, getPriority
-
-
-
-
Method Detail
-
generate
@Nonnull java.lang.String generate(ConfigurationProperty configurationProperty) throws java.lang.IllegalArgumentException
Generates a JSON representation of the givenConfigurationProperty
.- 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.
-
-