@Test public void getValuesReturnsTheBeginDateIfTheEndDateIsNull() { String beginYear = "1900"; Vertex vertex = vertex().withProperty(BEGIN_YEAR, beginYear).build(); DutchCaribbeanArchiveAndArchiverPeriodFacetDescription instance = new DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(FACET_NAME, BEGIN_YEAR, END_YEAR); List<String> values = instance.getValues(vertex); assertThat(values, contains(beginYear)); }
@Override public List<String> getValues(Vertex vertex) { List<String> values = Lists.newArrayList(); if (vertex.keys().contains(beginYear)) { values.add(vertex.value(beginYear)); } if (vertex.keys().contains(endYear)) { values.add(vertex.value(endYear)); } return values; }
DutchCaribbeanArchiveAndArchiverPeriodFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { List<String> values = Lists.newArrayList(); if (vertex.keys().contains(beginYear)) { values.add(vertex.value(beginYear)); } if (vertex.keys().contains(endYear)) { values.add(vertex.value(endYear)); } return values; } }
DutchCaribbeanArchiveAndArchiverPeriodFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { List<String> values = Lists.newArrayList(); if (vertex.keys().contains(beginYear)) { values.add(vertex.value(beginYear)); } if (vertex.keys().contains(endYear)) { values.add(vertex.value(endYear)); } return values; } DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear);   DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear,
                                                         FacetGetter facetGetter); }
DutchCaribbeanArchiveAndArchiverPeriodFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { List<String> values = Lists.newArrayList(); if (vertex.keys().contains(beginYear)) { values.add(vertex.value(beginYear)); } if (vertex.keys().contains(endYear)) { values.add(vertex.value(endYear)); } return values; } DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear);   DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear,
                                                         FacetGetter facetGetter); @Override String getName(); @Override Facet getFacet(Map<String, Set<Vertex>> values); @Override void filter(GraphTraversal<Vertex, Vertex> graphTraversal, List<FacetValue> facets); @Override List<String> getValues(Vertex vertex); }
DutchCaribbeanArchiveAndArchiverPeriodFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { List<String> values = Lists.newArrayList(); if (vertex.keys().contains(beginYear)) { values.add(vertex.value(beginYear)); } if (vertex.keys().contains(endYear)) { values.add(vertex.value(endYear)); } return values; } DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear);   DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear,
                                                         FacetGetter facetGetter); @Override String getName(); @Override Facet getFacet(Map<String, Set<Vertex>> values); @Override void filter(GraphTraversal<Vertex, Vertex> graphTraversal, List<FacetValue> facets); @Override List<String> getValues(Vertex vertex);  }