model/src/main/java/eu/internetofus/common/model/Model.java
/**
   * Return the model defined on the array.
   *
   * @param array to get the models.
   * @param type  of model to obtain
   * @param <T>   to obtain
   *
   * @return the models of the array, or {@code null} if it can not obtain all the
   *         models.
   */
Return the model defined on the array.
@param array to get the models.
@param type  of model to obtain
@param    to obtain

@return the models of the array, or  null if it can not obtain all the
models.
Return the model defined on the array . @param array to get the models . @param type of model to obtain @param to obtain @return the models of the array or null if it can not obtain all the models .
public static <T> List<T> fromJsonArray(final JsonArray array, final Class<T> type) {
    if (array == null) {
      return null;
    } else {
      final List<T> models = new ArrayList<>();
      for (var i = 0; i < array.size(); i++) {
        try {
          final var value = array.getJsonObject(i);
          final var model = fromJsonObject(value, type);
          if (model == null) {
            return null;
          }
          models.add(model);
        } catch (final Throwable throwable) {
          Logger.trace(throwable);
          return null;
        }
      }
      return models;
    }
  }
public static < T > List < T > fromJsonArray ( final JsonArray array , final Class < T > type ) { if ( array == null ) { return null ; } else { final List < T > models = new ArrayList < > ( ) ; for ( var i = 0 ; i < array . size ( ) ; i ++ ) { try { final var value = array . getJsonObject ( i ) ; final var model = fromJsonObject ( value , type ) ; if ( model == null ) { return null ; } models . add ( model ) ; } catch ( final Throwable throwable ) { Logger . trace ( throwable ) ; return null ; } } return models ; } }
Return the model defined on the array.
Return the model defined on the array .