title: How to add a DynamoDB scan result to an object list?
body: <p>I am performing a scan on a DynamoDB table and I need to then add respective attributes from the returned items to a list of type <code>User</code> (<code>User</code> has a single constructor <code>User(String uuid)</code>). The code currently successfully scans the DB and returns a <code>List</code> of the scan results. However my iteration seems to return null for some reason. </p>
  
  <pre><code>    AmazonDynamoDBClient client = dynamoClient.getDynamoClient();
      DynamoDBMapper mapper = new DynamoDBMapper(client);
  
      try {
          DynamoDBScanExpression scanExpression = new DynamoDBScanExpression();
  
          Map&lt;String, Condition&gt; scanFilter = new HashMap&lt;String, Condition&gt;();
          Condition scanCondition = 
              new Condition().withComparisonOperator(ComparisonOperator.NOT_NULL);
          scanFilter.put("uuid", scanCondition);
          scanExpression.setScanFilter(scanFilter);
  
          List scanResults = mapper.scan(UserAccounts.class, scanExpression);
  
          for (Iterator it = scanResults.iterator(); it.hasNext();) {
              //User user = (User) it.next();
              allUserSummary.add(new User(scanResults.get(1).toString()));
          }
      } catch (Exception e) {
          // TODO
      }
  </code></pre>