O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Built-in converters

The MicroProfile Config implementation provides built-in converters for the primitive types (boolean, int, long, byte, float, and double) and their corresponding Java types (for example, Integer).

It also provides support for arrays in the property value using the "," as the item separator. If the "," must be part of an item, it must be escaped with a backslash "\":

private String[] pets = config.getValue("myPets", String[].class)

If the value of the myPets property is dog,cat,dog\\,cat, the elements of the array stored in pets would be {"dog", "cat", "dog,cat"}.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required