I have the following peace of code:

```kotlin
class JiraCredentials(applicationContext: Context)
{
    private val preferences = applicationContext.getSharedPreferences(
        "jira",
        ComponentActivity.MODE_PRIVATE
    )

    private val username_key = "username"
    var username: String
        get () = preferences.getString (username_key, "").toString()
        set (value) {
            val editor = preferences.edit()
            editor.putString (username_key, value)
            editor.commit ()
        }

    private val password_key = "password"
    var password: String
        get () = preferences.getString (password_key, "").toString()
        set (value) {
            val editor = preferences.edit()
            editor.putString (password_key, value)
            editor.commit ()
        }
}

```

As you can see the "username" part is almost the same as the "password" part. Other languages (Scheme, Rust) have ["hygienic macros"](https://en.wikipedia.org/wiki/Hygienic_macro) to handle this. What is the idiomatic way to handle this in Kotlin?