components/src/test/java/eu/internetofus/common/components/CRUDContext.java
/**
   * Return the handler to replace (put) a value for an identifier defined on the
   * path.
   *
   * @return the handler to replace value by its identifier.
   */
Return the handler to replace (put) a value for an identifier defined on the
path.

@return the handler to replace value by its identifier.
Return the handler to replace ( put ) a value for an identifier defined on the path . @return the handler to replace value by its identifier .
public Handler<RoutingContext> putHandler() {
    return this.toRoutingContextHandler((ctx, id, value) -> {
      var newValue = this.getNewValueFrom(ctx);
      if (newValue != null) {
        final var response = ctx.response();
        newValue = newValue.put(this.idName, id);
        if (CreateUpdateTsDetails.class.isAssignableFrom(this.modelType)) {
          final var now = TimeManager.now();
          newValue = newValue.put("_creationTs", value.getValue("_creationTs"));
          newValue = newValue.put("_lastUpdateTs", now);
        }
        this.values.put(id, newValue);
        response.setStatusCode(Status.OK.getStatusCode());
        response.end(newValue.toBuffer());
      }
    });
  }
public Handler < RoutingContext > putHandler ( ) { return this . toRoutingContextHandler ( ( ctx , id , value ) -> { var newValue = this . getNewValueFrom ( ctx ) ; if ( newValue != null ) { final var response = ctx . response ( ) ; newValue = newValue . put ( this . idName , id ) ; if ( CreateUpdateTsDetails . class . isAssignableFrom ( this . modelType ) ) { final var now = TimeManager . now ( ) ; newValue = newValue . put ( "_creationTs" , value . getValue ( "_creationTs" ) ) ; newValue = newValue . put ( "_lastUpdateTs" , now ) ; } this . values . put ( id , newValue ) ; response . setStatusCode ( Status . OK . getStatusCode ( ) ) ; response . end ( newValue . toBuffer ( ) ) ; } } ) ; }
Return the handler to replace (put) a value for an identifier defined on the
 path.
Return the handler to replace ( put ) a value for an identifier defined on the path .