model/src/main/java/eu/internetofus/common/model/Model.java
/**
   * Return the array represented by a list of models.
   *
   * @param models to encode to an array.
   *
   * @param <T>    to obtain
   *
   * @return the array that represents the models.
   */
Return the array represented by a list of models.
@param models to encode to an array.

@param     to obtain

@return the array that represents the models.
Return the array represented by a list of models . @param models to encode to an array . @param to obtain @return the array that represents the models .
public static <T> JsonArray toJsonArray(final Iterable<T> models) {
    if (models == null) {
      return null;
    } else {
      final var array = new JsonArray();
      for (final T model : models) {
        if (model instanceof Model) {
          final var object = ((Model) model).toJsonObject();
          array.add(object);
        } else {
          array.add(model);
        }
      }
      return array;
    }
  }
public static < T > JsonArray toJsonArray ( final Iterable < T > models ) { if ( models == null ) { return null ; } else { final var array = new JsonArray ( ) ; for ( final T model : models ) { if ( model instanceof Model ) { final var object = ( ( Model ) model ) . toJsonObject ( ) ; array . add ( object ) ; } else { array . add ( model ) ; } } return array ; } }
Return the array represented by a list of models.
Return the array represented by a list of models .