@Component
class Car @Autowired constructor (private val owner: Owner) {
fun getOwner() : Owner {
return owner
}
}
class Owner(private val name: String, private val address: String) {}
class Bug {
lateinit var desc: String;
lateinit var latestComment: String;
// a setter method so that the Spring container can inject desc and latestComment dependencies
@Autowired
fun updateBug(desc: String, latestComment: String) {
this.desc = desc;
this.latestComment = latestComment;
}
}