Interface Listifier<T>
- Type Parameters:
T
- The type of collection-like object this listifier handles
- All Superinterfaces:
BiFunction<BeanConverter,
T, List<Object>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Listifiers enable the Bean-Centric Testing framework to treat diverse collection-like objects uniformly during property access and iteration. They convert various iterable structures into a common List format for consistent processing.
Common Use Cases:
- Arrays: Convert primitive and object arrays to lists
- Streams: Materialize Stream objects to lists
- Custom collections: Extract elements from domain-specific collections
- Map entries: Convert Maps to lists of entry objects
- Iterables: Handle any Iterable implementation
Usage Examples:
Registration:
Best Practices:
- Preserve order when the original collection has meaningful ordering
- Handle empty cases gracefully (return empty list, not null)
- Consider performance for large collections (avoid full materialization when possible)
- Use converter parameter for swapping/transforming individual elements
-
Method Summary
Methods inherited from interface java.util.function.BiFunction
andThen, apply