/** * Returns string view of list of header values. Any modifications to the underlying list are visible to the view, * the view also supports removal of elements. Does not support other modifications. * * @param headerValues header values. * @param rd RuntimeDelegate instance or {@code null} (in that case {@link RuntimeDelegate#getInstance()} * will be called for before element conversion. * @return String view of header values. */ public static List<String> asStringList(final List<Object> headerValues, final RuntimeDelegate rd) { if (headerValues == null || headerValues.isEmpty()) { return Collections.emptyList(); } final RuntimeDelegate delegate; if (rd == null) { delegate = RuntimeDelegate.getInstance(); } else { delegate = rd; } return Views.listView(headerValues, input -> (input == null) ? "[null]" : HeaderUtils.asString(input, delegate)); }
/** * Returns string view of list of header values. Any modifications to the underlying list are visible to the view, * the view also supports removal of elements. Does not support other modifications. * * @param headerValues header values. * @param rd RuntimeDelegate instance or {@code null} (in that case {@link RuntimeDelegate#getInstance()} * will be called for before element conversion. * @return String view of header values. */ public static List<String> asStringList(final List<Object> headerValues, final RuntimeDelegate rd) { if (headerValues == null || headerValues.isEmpty()) { return Collections.emptyList(); } final RuntimeDelegate delegate; if (rd == null) { delegate = RuntimeDelegate.getInstance(); } else { delegate = rd; } return Views.listView(headerValues, input -> (input == null) ? "[null]" : HeaderUtils.asString(input, delegate)); }
/** * Returns string view of list of header values. Any modifications to the underlying list are visible to the view, * the view also supports removal of elements. Does not support other modifications. * * @param headerValues header values. * @param rd RuntimeDelegate instance or {@code null} (in that case {@link RuntimeDelegate#getInstance()} * will be called for before element conversion. * @return String view of header values. */ public static List<String> asStringList(final List<Object> headerValues, final RuntimeDelegate rd) { if (headerValues == null || headerValues.isEmpty()) { return Collections.emptyList(); } final RuntimeDelegate delegate; if (rd == null) { delegate = RuntimeDelegate.getInstance(); } else { delegate = rd; } return Views.listView(headerValues, input -> (input == null) ? "[null]" : HeaderUtils.asString(input, delegate)); }
/** * Returns string view of list of header values. Any modifications to the underlying list are visible to the view, * the view also supports removal of elements. Does not support other modifications. * * @param headerValues header values. * @param rd RuntimeDelegate instance or {@code null} (in that case {@link RuntimeDelegate#getInstance()} * will be called for before element conversion. * @return String view of header values. */ public static List<String> asStringList(final List<Object> headerValues, final RuntimeDelegate rd) { if (headerValues == null || headerValues.isEmpty()) { return Collections.emptyList(); } final RuntimeDelegate delegate; if (rd == null) { delegate = RuntimeDelegate.getInstance(); } else { delegate = rd; } return Views.listView(headerValues, input -> (input == null) ? "[null]" : HeaderUtils.asString(input, delegate)); }