build method
Converts the internal typed map to a standard Map<String, dynamic>,
mapping each JetleafProperty.key to its associated value.
This result is suitable for passing into application environments or serialization.
Example:
final property = ConfigurationProperties({
JetleafProperty.SERVER_PORT: 8081,
JetleafProperty.SECURITY_ENABLED: true,
JetleafProperty.MY_FEATURE_ENABLED: true,
});
final result = property.build();
resource.load(result);
ConfigurationProperties is a class for defining application configuration in a typed and expressive way,
similar to defining settings in application.yaml, but directly in Dart.
This provides a structured way to define and access configuration properties.
Example: Typed config definition
ConfigurationProperties({
JetleafProperty.SERVER_PORT.copyWith(value: 8081),
JetleafProperty.SECURITY_ENABLED.copyWith(value: true),
JetleafProperty.MY_FEATURE_ENABLED.copyWith(value: true),
})
Implementation
Map<String, Object> build() => _properties.toMap((key) => key.key, (key) => key.value);