private void paging() { // get the list of users UserList users = client.listUsers(); // get the first user in the collection log.info("First user in collection: {}", users.iterator().next().getProfile().getEmail()); // or loop through all of them (paging is automatic) for (User tmpUser : users) { log.info("User: {}", tmpUser.getProfile().getEmail()); } // or via a stream users.stream().forEach(tmpUser -> log.info("User: {}", tmpUser.getProfile().getEmail())); } }
private void paging() { // get the list of users UserList users = client.listUsers(); // get the first user in the collection log.info("First user in collection: {}", users.iterator().next().getProfile().getEmail()); // or loop through all of them (paging is automatic) for (User tmpUser : users) { log.info("User: {}", tmpUser.getProfile().getEmail()); } // or via a stream users.stream().forEach(tmpUser -> log.info("User: {}", tmpUser.getProfile().getEmail())); } }
UserList users = client.listUsers();
UserList users = client.listUsers();