8000 Provide default value for configuration · Issue #21 · gojek/courier-android · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Provide default value for configuration  #21
Open
@radityagumay

Description

@radityagumay

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0