I suggest you start using a modern and compact list iteration with For-Each Loop , which helps to avoid many common mistakes when using the old iteration style:
[...]
. , . : , . . :
void cancelAll(Collection<TimerTask> c) {
for (TimerTask t : c)
t.cancel();
}
, :
List<UserAccounts> scanResults = mapper.scan(UserAccounts.class, scanExpression);
for (UserAccounts userAccounts : scanResults) {
allUserSummary.add(new User(userAccounts.toString()));
}
, , , toString() UserAccounts uuid, . , getKey() getUuidAttribute() @DynamoDBHashKey @DynamoDBAttribute, Class DynamoDBMapper, :
@DynamoDBTable(tableName = "UserAccounts")
public class UserAccounts{
private String key;
@DynamoDBHashKey
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
}
, , :
List<UserAccounts> scanResults = mapper.scan(UserAccounts.class, scanExpression);
for (UserAccounts userAccounts : scanResults) {
allUserSummary.add(new User(userAccounts.getKey()));
}