Skip to content

Instantly share code, notes, and snippets.

@billydh
Last active November 30, 2020 23:26
Show Gist options
  • Save billydh/17dbf51d47400fe763af769361fb3f14 to your computer and use it in GitHub Desktop.
Save billydh/17dbf51d47400fe763af769361fb3f14 to your computer and use it in GitHub Desktop.
package com.thecodebrews.kotlinspringvaluedemo
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Component
import javax.annotation.PostConstruct
@Component
class StoreConfiguration {
@Value("\${store.size-in-meter-square}")
val size: Int = 0
@PostConstruct
fun getStoreConfiguration() {
print("Store size is $size meter square\n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment