@Test public void testLastModifiedExtractionWhenNull() { assertThat(underTest.extractLastModified(searchHit), is(nullValue())); }
@Nullable public DateTime extractLastModified(final SearchHit searchHit) { Number timestamp = extractAttribute(searchHit, "content", P_LAST_MODIFIED, Number.class); if (timestamp != null) { return new DateTime(timestamp.longValue()); } else { return null; } }
NpmSearchHitExtractor extends ComponentSupport { @Nullable public DateTime extractLastModified(final SearchHit searchHit) { Number timestamp = extractAttribute(searchHit, "content", P_LAST_MODIFIED, Number.class); if (timestamp != null) { return new DateTime(timestamp.longValue()); } else { return null; } } }
NpmSearchHitExtractor extends ComponentSupport { @Nullable public DateTime extractLastModified(final SearchHit searchHit) { Number timestamp = extractAttribute(searchHit, "content", P_LAST_MODIFIED, Number.class); if (timestamp != null) { return new DateTime(timestamp.longValue()); } else { return null; } }  }
NpmSearchHitExtractor extends ComponentSupport { @Nullable public DateTime extractLastModified(final SearchHit searchHit) { Number timestamp = extractAttribute(searchHit, "content", P_LAST_MODIFIED, Number.class); if (timestamp != null) { return new DateTime(timestamp.longValue()); } else { return null; } }  @Nullable String extractName(final SearchHit searchHit); @Nullable String extractVersion(final SearchHit searchHit); @Nullable String extractDescription(final SearchHit searchHit); @Nullable String extractAuthorName(final SearchHit searchHit); @Nullable String extractAuthorEmail(final SearchHit searchHit); List<String> extractKeywords(final SearchHit searchHit); @Nullable String extractHomepage(final SearchHit searchHit); @Nullable String extractRepositoryUrl(final SearchHit searchHit); @Nullable String extractBugsUrl(final SearchHit searchHit); @Nullable DateTime extractLastModified(final SearchHit searchHit); }
NpmSearchHitExtractor extends ComponentSupport { @Nullable public DateTime extractLastModified(final SearchHit searchHit) { Number timestamp = extractAttribute(searchHit, "content", P_LAST_MODIFIED, Number.class); if (timestamp != null) { return new DateTime(timestamp.longValue()); } else { return null; } }  @Nullable String extractName(final SearchHit searchHit); @Nullable String extractVersion(final SearchHit searchHit); @Nullable String extractDescription(final SearchHit searchHit); @Nullable String extractAuthorName(final SearchHit searchHit); @Nullable String extractAuthorEmail(final SearchHit searchHit); List<String> extractKeywords(final SearchHit searchHit); @Nullable String extractHomepage(final SearchHit searchHit); @Nullable String extractRepositoryUrl(final SearchHit searchHit); @Nullable String extractBugsUrl(final SearchHit searchHit); @Nullable DateTime extractLastModified(final SearchHit searchHit);  }