@Test public void toJSONWithGenes() { final JSONObject actual = this.component.toJSON(); final JSONObject expected = new JSONObject().put(ID_LABEL, HP01).put(NAME_LABEL, HP01_NAME).put(COUNT_LABEL, 4); Assert.assertTrue(expected.similar(actual)); }
@Override public JSONObject toJSON() { return new JSONObject() .putOpt(ID_LABEL, getId()) .putOpt(NAME_LABEL, getName()) .put(COUNT_LABEL, getCount()); }
DefaultMatchCountImpl implements MatchCount { @Override public JSONObject toJSON() { return new JSONObject() .putOpt(ID_LABEL, getId()) .putOpt(NAME_LABEL, getName()) .put(COUNT_LABEL, getCount()); } }
DefaultMatchCountImpl implements MatchCount { @Override public JSONObject toJSON() { return new JSONObject() .putOpt(ID_LABEL, getId()) .putOpt(NAME_LABEL, getName()) .put(COUNT_LABEL, getCount()); } DefaultMatchCountImpl(@Nonnull final VocabularyTerm term, @Nullable final Collection<String> associatedGenes); }
DefaultMatchCountImpl implements MatchCount { @Override public JSONObject toJSON() { return new JSONObject() .putOpt(ID_LABEL, getId()) .putOpt(NAME_LABEL, getName()) .put(COUNT_LABEL, getCount()); } DefaultMatchCountImpl(@Nonnull final VocabularyTerm term, @Nullable final Collection<String> associatedGenes); @Override int getCount(); @Override String getId(); @Override String getName(); @Override Collection<String> getGenes(); @Override JSONObject toJSON(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override int compareTo(@Nonnull final MatchCount o); }
DefaultMatchCountImpl implements MatchCount { @Override public JSONObject toJSON() { return new JSONObject() .putOpt(ID_LABEL, getId()) .putOpt(NAME_LABEL, getName()) .put(COUNT_LABEL, getCount()); } DefaultMatchCountImpl(@Nonnull final VocabularyTerm term, @Nullable final Collection<String> associatedGenes); @Override int getCount(); @Override String getId(); @Override String getName(); @Override Collection<String> getGenes(); @Override JSONObject toJSON(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override int compareTo(@Nonnull final MatchCount o);  }