model/src/main/java/eu/internetofus/common/model/Model.java
/**
   * Convert a model to a {@link JsonObject} with all the {@code null} and empty
   * values.
   *
   * @return the object of the model or {@code null} if can not convert it.
   *
   * @see ModelForJsonObjectWithEmptyValues
   */
Convert a model to a  JsonObject with all the  null and empty
values.

@return the object of the model or  null if can not convert it.


Convert a model to a JsonObject with all the null and empty values . @return the object of the model or null if can not convert it .
default public JsonObject toJsonObjectWithEmptyValues() {
    try {
      final var mapper = DatabindCodec.mapper().copy();
      mapper.addMixIn(Model.class, ModelForJsonObjectWithEmptyValues.class);
      final var json = mapper.writeValueAsString(this);
      Buffer.buffer(json);
      return new JsonObject(json);
    } catch (final Throwable throwable) {
      Logger.trace(throwable);
      return null;
    }
  }
default public JsonObject toJsonObjectWithEmptyValues ( ) { try { final var mapper = DatabindCodec . mapper ( ) . copy ( ) ; mapper . addMixIn ( Model . class , ModelForJsonObjectWithEmptyValues . class ) ; final var json = mapper . writeValueAsString ( this ) ; Buffer . buffer ( json ) ; return new JsonObject ( json ) ; } catch ( final Throwable throwable ) { Logger . trace ( throwable ) ; return null ; } }
Convert a model to a {@link JsonObject} with all the {@code null} and empty
 values.
Convert a model to a { @link JsonObject } with all the { @code null } and empty values .