https://kotlinlang.org logo
#getting-started
Title
# getting-started
m

matej

04/02/2016, 3:06 PM
@vint Ah, that's another matter. If you have a model that you both want to be able to enumerate SOME members of, but still reserve the option to create others on the fly, your best bet is to start with an interface, e.g. Currency, then make an Enum implement it, e.g. KnownCurrency, and have another simple data class, e.g. DynamicCurrency, implement the same interface, for which you can construct instances by just passing a symbol or currency code to the constructor.
👍 1