@Test public void fromJsonString_toMap_createsExpectedMap() { assertMapEquals(EXAMPLE_MAP_CODE_VERIFICATION, mCodeVerification.toMap()); }
@NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_ATTEMPTS_REMAINING, mAttemptsRemaining); if (mStatus != null) { hashMap.put(FIELD_STATUS, mStatus); } return hashMap; }
SourceCodeVerification extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_ATTEMPTS_REMAINING, mAttemptsRemaining); if (mStatus != null) { hashMap.put(FIELD_STATUS, mStatus); } return hashMap; } }
SourceCodeVerification extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_ATTEMPTS_REMAINING, mAttemptsRemaining); if (mStatus != null) { hashMap.put(FIELD_STATUS, mStatus); } return hashMap; } SourceCodeVerification(int attemptsRemaining, @Status String status); }
SourceCodeVerification extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_ATTEMPTS_REMAINING, mAttemptsRemaining); if (mStatus != null) { hashMap.put(FIELD_STATUS, mStatus); } return hashMap; } SourceCodeVerification(int attemptsRemaining, @Status String status); int getAttemptsRemaining(); @Status String getStatus(); @NonNull @Override Map<String, Object> toMap(); @NonNull @Override JSONObject toJson(); @Nullable static SourceCodeVerification fromString(@Nullable String jsonString); @Nullable static SourceCodeVerification fromJson(@Nullable JSONObject jsonObject); }
SourceCodeVerification extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_ATTEMPTS_REMAINING, mAttemptsRemaining); if (mStatus != null) { hashMap.put(FIELD_STATUS, mStatus); } return hashMap; } SourceCodeVerification(int attemptsRemaining, @Status String status); int getAttemptsRemaining(); @Status String getStatus(); @NonNull @Override Map<String, Object> toMap(); @NonNull @Override JSONObject toJson(); @Nullable static SourceCodeVerification fromString(@Nullable String jsonString); @Nullable static SourceCodeVerification fromJson(@Nullable JSONObject jsonObject);  }