vertx/src/main/java/eu/internetofus/common/vertx/AbstractMain.java
/**
   * Configure using the specified properties.
   *
   * @param properties to configure.
   */
Configure using the specified properties.
@param properties to configure.
Configure using the specified properties . @param properties to configure .
protected void configureWithPropetyValues(final Properties properties) {
    final var userProperties = new JsonObject();
    for (final String key : properties.stringPropertyNames()) {
      var property = userProperties;
      final var sections = key.split("\\.");
      for (var i = 0; i < sections.length - 1; i++) {
        final var section = sections[i].trim();
        if (property.containsKey(section)) {
          property = property.getJsonObject(section);
        } else {
          final var sectionProperty = new JsonObject();
          property.put(section, sectionProperty);
          property = sectionProperty;
        }
      }
      final var value = properties.getProperty(key).trim();
      if (value.matches("\".*\"")) {
        property.put(sections[sections.length - 1], value.substring(1, value.length() - 1));
      } else if (Boolean.TRUE.toString().equalsIgnoreCase(value) || Boolean.FALSE.toString().equalsIgnoreCase(value)) {
        property.put(sections[sections.length - 1], Boolean.valueOf(value));
      } else {
        try {
          final Number number = Integer.parseInt(value);
          property.put(sections[sections.length - 1], number);
        } catch (final Throwable ignored) {
          property.put(sections[sections.length - 1], value);
        }
      }
    }
    final var userPropertiesConf = new ConfigStoreOptions().setType("json").setConfig(userProperties);
    this.retrieveOptions = this.retrieveOptions.addStore(userPropertiesConf);
  }
protected void configureWithPropetyValues ( final Properties properties ) { final var userProperties = new JsonObject ( ) ; for ( final String key : properties . stringPropertyNames ( ) ) { var property = userProperties ; final var sections = key . split ( "\\." ) ; for ( var i = 0 ; i < sections . length - 1 ; i ++ ) { final var section = sections [ i ] . trim ( ) ; if ( property . containsKey ( section ) ) { property = property . getJsonObject ( section ) ; } else { final var sectionProperty = new JsonObject ( ) ; property . put ( section , sectionProperty ) ; property = sectionProperty ; } } final var value = properties . getProperty ( key ) . trim ( ) ; if ( value . matches ( "\".*\"" ) ) { property . put ( sections [ sections . length - 1 ] , value . substring ( 1 , value . length ( ) - 1 ) ) ; } else if ( Boolean . TRUE . toString ( ) . equalsIgnoreCase ( value ) || Boolean . FALSE . toString ( ) . equalsIgnoreCase ( value ) ) { property . put ( sections [ sections . length - 1 ] , Boolean . valueOf ( value ) ) ; } else { try { final Number number = Integer . parseInt ( value ) ; property . put ( sections [ sections . length - 1 ] , number ) ; } catch ( final Throwable ignored ) { property . put ( sections [ sections . length - 1 ] , value ) ; } } } final var userPropertiesConf = new ConfigStoreOptions ( ) . setType ( "json" ) . setConfig ( userProperties ) ; this . retrieveOptions = this . retrieveOptions . addStore ( userPropertiesConf ) ; }
Configure using the specified properties.
Configure using the specified properties .