@Test public void testAddRequestCount() { String url = "http: DocumentStatistics stats = new DocumentStatistics(url); assertThat(stats.getRequestCounts()).hasSize(0); int count = 1; TranslationRequestStatistics requestStats = new TranslationRequestStatistics(LocaleCode.EN_US.getId(), LocaleCode.FR.getId(), count, 10); stats.addRequestCount(requestStats.getFromLocaleCode(), requestStats.getToLocaleCode(), count, requestStats.getWordCount()); assertThat(stats.getRequestCounts()).hasSize(1) .contains(requestStats); }
public void addRequestCount(String fromLocaleCode, String toLocaleCode, int count, int totalWordCount) { boolean inserted = false; for (TranslationRequestStatistics stats : requestCounts) { if (stats.getFromLocaleCode().equals(fromLocaleCode) && stats.getToLocaleCode().equals(toLocaleCode)) { stats.addCount(count); inserted = true; break; } } if (!inserted) { requestCounts.add(new TranslationRequestStatistics(fromLocaleCode, toLocaleCode, count, totalWordCount)); } }
DocumentStatistics implements Serializable { public void addRequestCount(String fromLocaleCode, String toLocaleCode, int count, int totalWordCount) { boolean inserted = false; for (TranslationRequestStatistics stats : requestCounts) { if (stats.getFromLocaleCode().equals(fromLocaleCode) && stats.getToLocaleCode().equals(toLocaleCode)) { stats.addCount(count); inserted = true; break; } } if (!inserted) { requestCounts.add(new TranslationRequestStatistics(fromLocaleCode, toLocaleCode, count, totalWordCount)); } } }
DocumentStatistics implements Serializable { public void addRequestCount(String fromLocaleCode, String toLocaleCode, int count, int totalWordCount) { boolean inserted = false; for (TranslationRequestStatistics stats : requestCounts) { if (stats.getFromLocaleCode().equals(fromLocaleCode) && stats.getToLocaleCode().equals(toLocaleCode)) { stats.addCount(count); inserted = true; break; } } if (!inserted) { requestCounts.add(new TranslationRequestStatistics(fromLocaleCode, toLocaleCode, count, totalWordCount)); } } @SuppressWarnings("unused") protected  DocumentStatistics();  DocumentStatistics(String url); }
DocumentStatistics implements Serializable { public void addRequestCount(String fromLocaleCode, String toLocaleCode, int count, int totalWordCount) { boolean inserted = false; for (TranslationRequestStatistics stats : requestCounts) { if (stats.getFromLocaleCode().equals(fromLocaleCode) && stats.getToLocaleCode().equals(toLocaleCode)) { stats.addCount(count); inserted = true; break; } } if (!inserted) { requestCounts.add(new TranslationRequestStatistics(fromLocaleCode, toLocaleCode, count, totalWordCount)); } } @SuppressWarnings("unused") protected  DocumentStatistics();  DocumentStatistics(String url); void addRequestCount(String fromLocaleCode, String toLocaleCode,
            int count, int totalWordCount); @JsonProperty("url") @NotNull @DocumentationExample("http://example.com") String getUrl(); @JsonProperty("requestCounts") @NotNull List<TranslationRequestStatistics> getRequestCounts(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); }
DocumentStatistics implements Serializable { public void addRequestCount(String fromLocaleCode, String toLocaleCode, int count, int totalWordCount) { boolean inserted = false; for (TranslationRequestStatistics stats : requestCounts) { if (stats.getFromLocaleCode().equals(fromLocaleCode) && stats.getToLocaleCode().equals(toLocaleCode)) { stats.addCount(count); inserted = true; break; } } if (!inserted) { requestCounts.add(new TranslationRequestStatistics(fromLocaleCode, toLocaleCode, count, totalWordCount)); } } @SuppressWarnings("unused") protected  DocumentStatistics();  DocumentStatistics(String url); void addRequestCount(String fromLocaleCode, String toLocaleCode,
            int count, int totalWordCount); @JsonProperty("url") @NotNull @DocumentationExample("http://example.com") String getUrl(); @JsonProperty("requestCounts") @NotNull List<TranslationRequestStatistics> getRequestCounts(); @Override boolean equals(@Nullable Object o); @Override int hashCode();  }