Top Description Fields Constructors Methods
org.assertj.core.presentation

pack-priv final Class TransformingList<FROM, TO>

extends AbstractList<TO>
Class Inheritance
Type Parameters
<FROM>
the type to convert from
<TO>
the type to convert to
Static Imports
java.util.Objects.requireNonNull

Converts elements of one list to a different type on demand.

Field Summary

Modifier and TypeField and Description
private final List<? extends FROM>
source

The list to transform.

private final Function<? super FROM, ? extends TO>
transform

Converts elements to the new type.

Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv
TransformingList(final List<? extends FROM>
the list to transform
source
,
final Function<? super FROM, ? extends TO>
transforms elements to the output type
transform
)

Creates a new TransformingList.

Method Summary

Modifier and TypeMethod and Description
public TO
get(final int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

sourceback to summary
private final List<? extends FROM> source

The list to transform.

transformback to summary
private final Function<? super FROM, ? extends TO> transform

Converts elements to the new type.

Constructor Detail

TransformingListback to summary
pack-priv TransformingList(final List<? extends FROM> source, final Function<? super FROM, ? extends TO> transform)

Creates a new TransformingList.

Parameters
source:List<? extends FROM>

the list to transform

transform:Function<? super FROM, ? extends TO>

transforms elements to the output type

Method Detail

getback to summary
public TO get(final int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:TO

Doc from java.util.List.get.

the element at the specified position in this list

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override