Provide default value for configuration
radityagumay opened this issue · comments
raditya gumay commented
As we have seen in the example, the initialization of Courier took few configurations. Since most of them are a default
configuration. would be better if we create a bean in the configuration class itself, and the caller is able to mutate as per need. doing this would less overhead for setup the configuration
Example:
data class FooConfiguration(
val arg1: String,
val arg2: String,
val arg3: String
) {
fun default(): FooConfiguration {
return FooConfiguration(/*args*/, /*args*/, /*args*/)
}
}
// client side
val foo = FooConfiguration.default().copy(arg1 = "magic")