api/src/main/java/com/tersesystems/echopraxia/api/Value.java
/**
   * Turns an array of T into a list of fields using the transform function.
   *
   * @param transform the transform function
   * @param values the list of fields.
   * @param <T> THe type of the element
   * @return the Value.
   */
Turns an array of T into a list of fields using the transform function.
@param transform the transform function
@param values the list of fields.
@param  THe type of the element
@return the Value.
Turns an array of T into a list of fields using the transform function . @param transform the transform function @param values the list of fields . @param THe type of the element @return the Value .
@NotNull
  public static <T> ObjectValue object(
      @NotNull Function<T, Field> transform, T @NotNull [] values) {
    if (values == null || values.length == 0) {
      return ObjectValue.EMPTY;
    }
    List<Field> fields =
        Arrays.stream(values).map(transform).filter(Objects::nonNull).collect(Collectors.toList());
    return new ObjectValue(fields);
  }
@ NotNull public static < T > ObjectValue object ( @ NotNull Function < T , Field > transform , T @ NotNull [ ] values ) { if ( values == null || values . length == 0 ) { return ObjectValue . EMPTY ; } List < Field > fields = Arrays . stream ( values ) . map ( transform ) . filter ( Objects :: nonNull ) . collect ( Collectors . toList ( ) ) ; return new ObjectValue ( fields ) ; }
Turns an array of T into a list of fields using the transform function.
Turns an array of T into a list of fields using the transform function .