vertx/src/main/java/eu/internetofus/common/vertx/ModelResources.java
/**
   * Merge an element of a field defined into a model.
   *
   * @param valueToMerge      to merge the model field element.
   * @param element           to merge.
   * @param searcher          the function used to obtain a model from an
   *                          identifier.
   * @param getField          return the field value associated to a model.
   * @param searchElement     return the index of the element that has the
   *                          specified identifier.
   * @param storerMergedModel the function to store the updated model.
   * @param context           of the request.
   * @param success           to inform to the upgrade value
   *
   * @param <T>               type of model that contains the fields.
   * @param <IT>              type of the model identifier.
   * @param <E>               type of the field.
   * @param <IE>              type of the field identifier.
   * @param <C>               type of validation context to use.
   */
Merge an element of a field defined into a model.
@param valueToMerge      to merge the model field element.
@param element           to merge.
@param searcher          the function used to obtain a model from an
identifier.
@param getField          return the field value associated to a model.
@param searchElement     return the index of the element that has the
specified identifier.
@param storerMergedModel the function to store the updated model.
@param context           of the request.
@param success           to inform to the upgrade value

@param                type of model that contains the fields.
@param               type of the model identifier.
@param                type of the field.
@param               type of the field identifier.
@param                type of validation context to use.
Merge an element of a field defined into a model . @param valueToMerge to merge the model field element . @param element to merge . @param searcher the function used to obtain a model from an identifier . @param getField return the field value associated to a model . @param searchElement return the index of the element that has the specified identifier . @param storerMergedModel the function to store the updated model . @param context of the request . @param success to inform to the upgrade value @param type of model that contains the fields . @param type of the model identifier . @param type of the field . @param type of the field identifier . @param type of validation context to use .
static public <C extends ValidateContext<C>, T extends Model & Updateable<T, C>, IT, E extends Model & Mergeable<E, C>, IE> void mergeModelFieldElementChain(
      final JsonObject valueToMerge, @NotNull final ModelFieldContext<T, IT, E, IE, C> element,
      @NotNull final BiConsumer<IT, Handler<AsyncResult<T>>> searcher, @NotNull final Function<T, List<E>> getField,
      @NotNull final BiFunction<List<E>, IE, Integer> searchElement,
      final BiConsumer<T, Handler<AsyncResult<Void>>> storerMergedModel, final ServiceContext context,
      @NotNull final Runnable success) {
    changeModelFieldElementBeforeChain(valueToMerge, element, searcher, getField, searchElement, context,
        () -> merge(element, context,
            () -> changeModelFieldElementAfterChain(element, getField, storerMergedModel, context, success)));
  }
static public < C extends ValidateContext < C > , T extends Model & Updateable < T , C > , IT , E extends Model & Mergeable < E , C > , IE > void mergeModelFieldElementChain ( final JsonObject valueToMerge , @ NotNull final ModelFieldContext < T , IT , E , IE , C > element , @ NotNull final BiConsumer < IT , Handler < AsyncResult < T > > > searcher , @ NotNull final Function < T , List < E > > getField , @ NotNull final BiFunction < List < E > , IE , Integer > searchElement , final BiConsumer < T , Handler < AsyncResult < Void > > > storerMergedModel , final ServiceContext context , @ NotNull final Runnable success ) { changeModelFieldElementBeforeChain ( valueToMerge , element , searcher , getField , searchElement , context , ( ) -> merge ( element , context , ( ) -> changeModelFieldElementAfterChain ( element , getField , storerMergedModel , context , success ) ) ) ; }
Merge an element of a field defined into a model.
Merge an element of a field defined into a model .