Original Title: What does scalar mean in Cucumber DataTables in Java?
From this reference:
Java provides several scalar types. These include primitive numeric types, plus boolean and char.
Every scalar (primitive) type has an associated wrapper class or reference type.
Reading the javadocs:
/**
* Converts the table to a List.
*
* If {@code itemType} is a scalar type the table is flattened.
*
* Otherwise, the top row is used to name the fields/properties and the remaining
* rows are turned into list items.
*
* @param itemType the type of the list items
* @param <T> the type of the list items
* @return a List of objects
*/
public <T> List<T> asList(Class<T> itemType) {
return tableConverter.toList(this, itemType);
}
/**
* Converts the table to a List of List of scalar.
*
* @param itemType the type of the list items
* @param <T> the type of the list items
* @return a List of List of objects
*/
public <T> List<List<T>>> asLists(Class<T> itemType) {
return tableConverter.toLists(this, itemType);
}
However, I was able to pass String.class in asList():
List<String> list = dataTable.asList(String.class);
A String is not a primitive in Java. I would like some clarification on what "scalar" means in this context.