@Volatile private var adapter: JsonAdapter<RateAppReminder>? = nullprivate fun getJsonAdapter(moshi: Moshi): JsonAdapter<RateAppReminder> = adapter ?: synchronized(this) { moshi.adapter<RateAppReminder>(RateAppReminder::class.java)}
NOTE: Refer to this example for optional parameter.
If no parameter is required, consider using lazy property.
val moshiStringListAdapter by lazy { moshi.adapter<MutableList<String>>(List::class.java)}
NOTE: To use lazy property with parameter, do look into this.