This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pureconfig.loadConfig | |
case class CompanyEmployee(companyName: String, place: String) | |
case class Employee(jobTitle: String, company: CompanyEmployee) | |
loadConfig[Employee](config, "se.pureconfig.example") | |
// res3: Either[pureconfig.error.ConfigReaderFailures,Employee] = Right(Employee(Software consultant,CompanyEmployee("Knoldus","Noida"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.typesafe.config._ | |
case class Employee(config: Config) { | |
val jobTitle = config.getString("jobTitle") | |
object company { | |
val companyName = config.getString("company.companyName") | |
val place = config.getString("company.place") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.typesafe.config._ | |
case class Employee(config: Config) { | |
val jobTitle = config.getString("jobTitle") | |
object company { | |
val companyName = config.getString("company.companyName") | |
val place = config.getString("company.place") | |
} | |
} |