title: How to convert a DataTable in Cucumber to a List of objects?
body: <h2>Original Title: What does scalar mean in Cucumber DataTables in Java?</h2>
  
  <p>From <a href="https://books.google.com.ph/books?id=dJ_DXvFnIgoC&amp;pg=PA31&amp;lpg=PA31&amp;dq=scalar+fundamentals+java&amp;source=bl&amp;ots=iqGWFZYSy0&amp;sig=hFkowfF15hv1WP6jB0j68G_vKco&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwiWy732gpjWAhXLLyYKHbrKBNoQ6AEIJDAA#v=onepage&amp;q=scalar%20fundamentals%20java&amp;f=false" rel="nofollow noreferrer">this</a> reference:</p>
  
  <blockquote>
    <p>Java provides several scalar types. These include primitive numeric
    types, plus boolean and char.</p>
    
    <p>Every scalar (primitive) type has an associated wrapper class or
    reference type.</p>
  </blockquote>
  
  <p>Reading the javadocs:</p>
  
  <pre><code>/**
    * 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 &lt;T&gt;      the type of the list items
    * @return a List of objects
    */
  public &lt;T&gt; List&lt;T&gt; asList(Class&lt;T&gt; 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 &lt;T&gt;      the type of the list items
    * @return a List of List of objects
    */
  public &lt;T&gt; List&lt;List&lt;T&gt;&gt;&gt; asLists(Class&lt;T&gt; itemType) {
      return tableConverter.toLists(this, itemType);
  }
  </code></pre>
  
  <p>However, I was able to pass String.class in asList():</p>
  
  <pre><code>List&lt;String&gt; list = dataTable.asList(String.class);
  </code></pre>
  
  <p>A String is not a primitive in Java. I would like some clarification on what "scalar" means in this context.</p>