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

Automatic converters

MicroProfile Config also defines automatic converters. If a converter is not known for a given Java type, it will attempt to convert a String object into it using any one of the three different approaches:

  • The Java type has a public constructor with a String parameter.
  • It has a public static valueOf(String) method.
  • It has a public static parse(String) method.

That's how the my.url property was converted from String into URL since the java.net.URL type has the public URL(String) constructor.

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