- Hands-On Enterprise Java Microservices with Eclipse MicroProfile
- Cesar Saavedra Heiko W. Rupp Jeff Mesnil Pavol Loffay Antoine Sabot Durand Scott Stark
- 119字
- 2021-06-24 12:56:22
Using converters for high-level configuration
MicroProfile Config will read Java String objects from its ConfigSource. However, it provides facilities to convert these String objects into more specific types in your application.
For example, the myUrl field we described previously is a URL object. The corresponding property, my.url, is read as a String object and then converted into a URL object before it is injected.
If the application uses the Config object, the MicroProfile Config implementation will also convert the String object into the type passed as the second argument of the getValue and getOptionalValue methods. This conversion can be done using different converter types: built-in, automatic, and custom. We will talk about them in detail now.
推薦閱讀
- 計算機網(wǎng)絡(luò)與通信(第2版)
- 物聯(lián)網(wǎng)安全(原書第2版)
- SEO 20日
- Hands-On Industrial Internet of Things
- INSTANT PhpStorm Starter
- 網(wǎng)絡(luò)創(chuàng)新指數(shù)研究
- React:Cross-Platform Application Development with React Native
- CCNP TSHOOT(642-832)認證考試指南
- The Kubernetes Workshop
- Echo Quick Start Guide
- Implementing NetScaler VPX?
- 數(shù)據(jù)血緣分析原理與實踐
- 網(wǎng)絡(luò)空間全球治理觀察
- 物聯(lián)網(wǎng)的機遇與利用
- Selenium WebDriver 3 Practical Guide