Class TransformingList<FROM,TO>

java.lang.Object
java.util.AbstractCollection<TO>
java.util.AbstractList<TO>
org.assertj.core.presentation.TransformingList<FROM,TO>
Type Parameters:
FROM - the type to convert from
TO - the type to convert to
All Implemented Interfaces:
Iterable<TO>, Collection<TO>, List<TO>

final class TransformingList<FROM,TO> extends AbstractList<TO>
Converts elements of one list to a different type on demand.
  • Field Details

    • source

      private final List<? extends FROM> source
      The list to transform.
    • transform

      private final Function<? super FROM,? extends TO> transform
      Converts elements to the new type.
  • Constructor Details

    • TransformingList

      TransformingList(List<? extends FROM> source, Function<? super FROM,? extends TO> transform)
      Creates a new TransformingList.
      Parameters:
      source - the list to transform
      transform - transforms elements to the output type
  • Method Details