I have an interface called UserManager
which has a var of type User
interface UserManager {
var user:User
/* ... */
}
and a class named UserManagerImpl
that implements UserManager
class UserManagerImpl : UserManager {
override var user: User // = uma instancia default de User deve ser fornecida
/* ... */
}
My question is as follows
How to allow a class to set aUser
in UserManager()
at any time (* ie * I would not provide a User
default ), but would leave that another class would create and select a User
when needed)?
Notes
User
class to be not null , so I did not want null
to be the default value for user
ie doing var user: User? = null
)