コード例 #1
0
  public List<String> follows(String userName) {

    List<HashMap<String, String>> messages =
        new ArrayList<HashMap<String, String>>(
            restTemplate
                .getForObject(baseURL + userName + "/follows.json", Resources.class)
                .getContent());

    LocalDateTime ldtNow =
        (new Date()).toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();

    List<String> following = new ArrayList<>();

    for (HashMap<String, String> mapMessage : messages) {
      following.add(mapMessage.get("followsUser"));
    }

    return following;
  }