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.
推薦閱讀
- 社交網絡對齊
- Application Development with Qt Creator(Second Edition)
- 連接未來:從古登堡到谷歌的網絡革命
- Mastering Machine Learning for Penetration Testing
- INSTANT PhpStorm Starter
- Learning Karaf Cellar
- 網絡的琴弦:玩轉IP看監控
- SSL VPN : Understanding, evaluating and planning secure, web/based remote access
- Building RESTful Web services with Go
- 從實踐中學習手機抓包與數據分析
- 物聯網頂層設計與關鍵技術
- 數據血緣分析原理與實踐
- MobX Quick Start Guide
- MPLS網絡設計權威指南
- Developing Web Applications with Oracle ADF Essentials