作品 プリミティブ型の場合、kotlinの@Autowiredや@Valueのようなスプリング注釈の使い方は?春の注釈と非プリミティブをオートワイヤリング
@Autowired
lateinit var metaDataService: MetaDataService
のような。
しかし、これは動作しません:エラーと
@Value("\${cacheTimeSeconds}")
lateinit var cacheTimeSeconds: Int
を:
lateinit modifier is not allowed for primitive types.
kotlinクラスにprimitveプロパティをautowireする方法は?
null可能なバージョンをオートワイヤリングできますか?フィールドは遅くなければならない – jrtapsell
はい、var todCacheTimeSeconds:Int? = nullは動作しますが、それは私が望むものではありません。 – fkurth