@Test public void nullCases() { assertThat(subject.bioentityProperties(GENE_ID, SPECIES, ImmutableList.of(), ImmutableMap.of())) .isEqualTo(new JsonArray()); assertThat( subject.bioentityProperties( GENE_ID, SPECIES, ImmutableList.of(BioentityPropertyName.GO), ImmutableMap.of())) .isEqualTo(new JsonArray()); assertThat( subject.bioentityProperties( GENE_ID, SPECIES, ImmutableList.of(BioentityPropertyName.GO), ImmutableMap.of(BioentityPropertyName.PATHWAYID, ImmutableSet.of()))) .isEqualTo(new JsonArray()); assertThat( subject.bioentityProperties( GENE_ID, SPECIES, ImmutableList.of(BioentityPropertyName.GO), ImmutableMap.of(BioentityPropertyName.GO, ImmutableSet.of()))). isEqualTo(new JsonArray()); }
JsonArray bioentityProperties(String identifier, Species species, List<BioentityPropertyName> desiredOrderOfPropertyNames, Map<BioentityPropertyName, Set<String>> propertyValuesByType) { JsonArray result = new JsonArray(); for (BioentityPropertyName bioentityPropertyName : propertiesWeWillDisplay(desiredOrderOfPropertyNames, propertyValuesByType)) { JsonArray values = new JsonArray(); for (PropertyLink propertyLink : createLinks( identifier, bioentityPropertyName, propertyValuesByType.get(bioentityPropertyName), species)) { values.add(propertyLink.toJson()); } if (values.size() > 0) { JsonObject o = new JsonObject(); o.addProperty("type", bioentityPropertyName.name); o.addProperty("name", bioentityPropertyName.label); o.add("values", values); result.add(o); } } return result; }
BioEntityCardModelFactory { JsonArray bioentityProperties(String identifier, Species species, List<BioentityPropertyName> desiredOrderOfPropertyNames, Map<BioentityPropertyName, Set<String>> propertyValuesByType) { JsonArray result = new JsonArray(); for (BioentityPropertyName bioentityPropertyName : propertiesWeWillDisplay(desiredOrderOfPropertyNames, propertyValuesByType)) { JsonArray values = new JsonArray(); for (PropertyLink propertyLink : createLinks( identifier, bioentityPropertyName, propertyValuesByType.get(bioentityPropertyName), species)) { values.add(propertyLink.toJson()); } if (values.size() > 0) { JsonObject o = new JsonObject(); o.addProperty("type", bioentityPropertyName.name); o.addProperty("name", bioentityPropertyName.label); o.add("values", values); result.add(o); } } return result; } }
BioEntityCardModelFactory { JsonArray bioentityProperties(String identifier, Species species, List<BioentityPropertyName> desiredOrderOfPropertyNames, Map<BioentityPropertyName, Set<String>> propertyValuesByType) { JsonArray result = new JsonArray(); for (BioentityPropertyName bioentityPropertyName : propertiesWeWillDisplay(desiredOrderOfPropertyNames, propertyValuesByType)) { JsonArray values = new JsonArray(); for (PropertyLink propertyLink : createLinks( identifier, bioentityPropertyName, propertyValuesByType.get(bioentityPropertyName), species)) { values.add(propertyLink.toJson()); } if (values.size() > 0) { JsonObject o = new JsonObject(); o.addProperty("type", bioentityPropertyName.name); o.addProperty("name", bioentityPropertyName.label); o.add("values", values); result.add(o); } } return result; } @Inject  BioEntityCardModelFactory(BioEntityPropertyService bioEntityPropertyService,
                                     ArrayDesignDao arrayDesignDao); }
BioEntityCardModelFactory { JsonArray bioentityProperties(String identifier, Species species, List<BioentityPropertyName> desiredOrderOfPropertyNames, Map<BioentityPropertyName, Set<String>> propertyValuesByType) { JsonArray result = new JsonArray(); for (BioentityPropertyName bioentityPropertyName : propertiesWeWillDisplay(desiredOrderOfPropertyNames, propertyValuesByType)) { JsonArray values = new JsonArray(); for (PropertyLink propertyLink : createLinks( identifier, bioentityPropertyName, propertyValuesByType.get(bioentityPropertyName), species)) { values.add(propertyLink.toJson()); } if (values.size() > 0) { JsonObject o = new JsonObject(); o.addProperty("type", bioentityPropertyName.name); o.addProperty("name", bioentityPropertyName.label); o.add("values", values); result.add(o); } } return result; } @Inject  BioEntityCardModelFactory(BioEntityPropertyService bioEntityPropertyService,
                                     ArrayDesignDao arrayDesignDao); Map<String, Object> modelAttributes(String identifier, Species species,
                                               List<BioentityPropertyName> orderedPropertyNames, String entityName,
                                               Map<BioentityPropertyName, Set<String>> propertyValuesByType); }
BioEntityCardModelFactory { JsonArray bioentityProperties(String identifier, Species species, List<BioentityPropertyName> desiredOrderOfPropertyNames, Map<BioentityPropertyName, Set<String>> propertyValuesByType) { JsonArray result = new JsonArray(); for (BioentityPropertyName bioentityPropertyName : propertiesWeWillDisplay(desiredOrderOfPropertyNames, propertyValuesByType)) { JsonArray values = new JsonArray(); for (PropertyLink propertyLink : createLinks( identifier, bioentityPropertyName, propertyValuesByType.get(bioentityPropertyName), species)) { values.add(propertyLink.toJson()); } if (values.size() > 0) { JsonObject o = new JsonObject(); o.addProperty("type", bioentityPropertyName.name); o.addProperty("name", bioentityPropertyName.label); o.add("values", values); result.add(o); } } return result; } @Inject  BioEntityCardModelFactory(BioEntityPropertyService bioEntityPropertyService,
                                     ArrayDesignDao arrayDesignDao); Map<String, Object> modelAttributes(String identifier, Species species,
                                               List<BioentityPropertyName> orderedPropertyNames, String entityName,
                                               Map<BioentityPropertyName, Set<String>> propertyValuesByType);  }