vertx/src/main/java/eu/internetofus/common/vertx/ModelResources.java
/**
   * Merge a JSON model to the defined on the DB.
   *
   * @param value    of the model to merge.
   * @param model    context of the model to merge.
   * @param searcher the function used to obtain a model.
   * @param updater  the function used to update a model.
   * @param context  of the request.
   * @param success  component to process the merged model.
   *
   * @param <T>      type of model to merge.
   * @param <I>      type of the model identifier.
   * @param <C>      type of validation context to use.
   */
Merge a JSON model to the defined on the DB.
@param value    of the model to merge.
@param model    context of the model to merge.
@param searcher the function used to obtain a model.
@param updater  the function used to update a model.
@param context  of the request.
@param success  component to process the merged model.

@param       type of model to merge.
@param       type of the model identifier.
@param       type of validation context to use.
Merge a JSON model to the defined on the DB . @param value of the model to merge . @param model context of the model to merge . @param searcher the function used to obtain a model . @param updater the function used to update a model . @param context of the request . @param success component to process the merged model . @param type of model to merge . @param type of the model identifier . @param type of validation context to use .
static public <C extends ValidateContext<C>, T extends Model & Mergeable<T, C>, I> void mergeModelChain(
      final JsonObject value, @NotNull final ModelContext<T, I, C> model,
      @NotNull final BiConsumer<I, Handler<AsyncResult<T>>> searcher,
      @NotNull final BiConsumer<T, Handler<AsyncResult<Void>>> updater, @NotNull final ServiceContext context,
      @NotNull final Runnable success) {
    toModel(value, model, context, () -> {
      retrieveModelChain(model, searcher, context, () -> {
        merge(model, context, () -> updateModelChain(model, updater, context, success));
      });
    });
  }
static public < C extends ValidateContext < C > , T extends Model & Mergeable < T , C > , I > void mergeModelChain ( final JsonObject value , @ NotNull final ModelContext < T , I , C > model , @ NotNull final BiConsumer < I , Handler < AsyncResult < T > > > searcher , @ NotNull final BiConsumer < T , Handler < AsyncResult < Void > > > updater , @ NotNull final ServiceContext context , @ NotNull final Runnable success ) { toModel ( value , model , context , ( ) -> { retrieveModelChain ( model , searcher , context , ( ) -> { merge ( model , context , ( ) -> updateModelChain ( model , updater , context , success ) ) ; } ) ; } ) ; }
Merge a JSON model to the defined on the DB.
Merge a JSON model to the defined on the DB .