In Kotlin, you cannot (and shouldn't anyway) change the "shape" of your instances at runtime, because the type system is here to protect users and provide guarantees on the values you're manipulating.
That being said, if what you need is a key-value store, where you can put key-value pairs and access values by their key, you should use an implementation of the MutableMap interface.
For instance, HashMap is an implementation of that interface:
val myMap = HashMap<String, Int>() myMap["newattribute"] = 2 println(myMap["newAttribute"]) // prints "2"
Note that the type of the keys and the values is well defined. A given Map can only deal with keys of the same type (here Strings), and values of the same type (here Ints). This means you cannot do myMap["stringProperty"] = "text" with the map defined in the above example.
If you really want something more general (especially for the values), you would need to use a wider type as your "values" type in the map. For instance, use MutableMap<String, Any> instead, so that the values can be of any non-null type:
val myMap = HashMap<String, Any>() myMap["intAttr"] = 42 myMap["strAttr"] = "text" println(myMap["intAttr"]) // prints "42" println(myMap["strAttr"]) // prints "text"