vertx/src/main/java/eu/internetofus/common/vertx/Repository.java
/**
   * Apply a map before return a model.
   *
   * @param model to return.
   * @param map   function to modify the model. If it is {@code null} no
   *              modification is applied.
   *
   * @return the future with the mapped result.
   *
   */
Apply a map before return a model.
@param model to return.
@param map   function to modify the model. If it is  null no
modification is applied.

@return the future with the mapped result.
Apply a map before return a model . @param model to return . @param map function to modify the model . If it is null no modification is applied . @return the future with the mapped result .
protected Future<JsonObject> applyMap(final JsonObject model, final Function<JsonObject, JsonObject> map) {
    if (map != null) {
      try {
        final var adaptedModel = map.apply(model);
        return Future.succeededFuture(adaptedModel);
      } catch (final Throwable throwable) {
        return Future.failedFuture(throwable);
      }
    } else {
      return Future.succeededFuture(model);
    }
  }
protected Future < JsonObject > applyMap ( final JsonObject model , final Function < JsonObject , JsonObject > map ) { if ( map != null ) { try { final var adaptedModel = map . apply ( model ) ; return Future . succeededFuture ( adaptedModel ) ; } catch ( final Throwable throwable ) { return Future . failedFuture ( throwable ) ; } } else { return Future . succeededFuture ( model ) ; } }
Apply a map before return a model.
Apply a map before return a model .