Пример #1
0
  private User getUserWithEmailAndPasswordFromJson(final String body) {
    final User user = new Customer(); // The implementation does not matter

    final JsonObject jsonObject = JsonReader.readAsJsonObject(body);
    user.setEmail(JsonReader.getStringOrNull(jsonObject, "email"));
    user.setPassword(JsonReader.getStringOrNull(jsonObject, "password"));

    return user;
  }
Пример #2
0
 private String getPasswordFromJson(final String body) {
   final JsonObject jsonObject = JsonReader.readAsJsonObject(body);
   return JsonReader.getStringOrNull(jsonObject, "password");
 }