Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default value for configuration #21

Open
radityagumay opened this issue Jun 16, 2022 · 0 comments
Open

Provide default value for configuration #21

radityagumay opened this issue Jun 16, 2022 · 0 comments

Comments

@radityagumay
Copy link

radityagumay commented Jun 16, 2022

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")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant