Skip to content

Commit

Permalink
add defualt constructor to proteome stats
Browse files Browse the repository at this point in the history
  • Loading branch information
supun-ebi committed Oct 18, 2023
1 parent a7e4dc0 commit f99e4f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.uniprot.core.proteome.impl;

import java.util.Objects;

import org.uniprot.core.impl.StatisticsImpl;
import org.uniprot.core.proteome.ProteomeStatistics;

import java.util.Objects;

public class ProteomeStatisticsImpl extends StatisticsImpl implements ProteomeStatistics {
private static final long serialVersionUID = -8585233468042758658L;
private final long isoformProteinCount;

ProteomeStatisticsImpl(
Expand All @@ -14,6 +15,10 @@ public class ProteomeStatisticsImpl extends StatisticsImpl implements ProteomeSt
this.isoformProteinCount = isoformProteinCount;
}

ProteomeStatisticsImpl() {
this(0, 0,0);
}

@Override
public long getIsoformProteinCount() {
return isoformProteinCount;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package org.uniprot.core.proteome.impl;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

class ProteomeStatisticsImplTest {
public static final int REVIEWED_PROTEIN_COUNT = 98;
public static final int UNREVIEWED_PROTEIN_COUNT = 33;
Expand All @@ -20,6 +21,13 @@ void getCountsAreAccurate() {
assertEquals(ISOFORM_PROTEIN_COUNT, PROTEOME_STATISTICS.getIsoformProteinCount());
}

@Test
void defaultConstructor() {
ProteomeStatisticsImpl that =
new ProteomeStatisticsImpl();
assertEquals(new ProteomeStatisticsImpl(0, 0, 0), that);
}

@Test
void equals_whenTrue() {
ProteomeStatisticsImpl that =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
package org.uniprot.core.json.parser.proteome;

import java.time.LocalDate;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.uniprot.core.CrossReference;
import org.uniprot.core.Database;
import org.uniprot.core.Value;
import org.uniprot.core.citation.Author;
import org.uniprot.core.citation.Book;
import org.uniprot.core.citation.ElectronicArticle;
import org.uniprot.core.citation.Journal;
import org.uniprot.core.citation.JournalArticle;
import org.uniprot.core.citation.Locator;
import org.uniprot.core.citation.Patent;
import org.uniprot.core.citation.PublicationDate;
import org.uniprot.core.citation.Submission;
import org.uniprot.core.citation.Thesis;
import org.uniprot.core.citation.Unpublished;
import org.uniprot.core.citation.impl.AuthorImpl;
import org.uniprot.core.citation.impl.BookImpl;
import org.uniprot.core.citation.impl.ElectronicArticleImpl;
import org.uniprot.core.citation.impl.JournalArticleImpl;
import org.uniprot.core.citation.impl.JournalImpl;
import org.uniprot.core.citation.impl.PatentImpl;
import org.uniprot.core.citation.impl.PublicationDateImpl;
import org.uniprot.core.citation.impl.SubmissionImpl;
import org.uniprot.core.citation.impl.ThesisImpl;
import org.uniprot.core.citation.impl.UnpublishedImpl;
import org.uniprot.core.citation.*;
import org.uniprot.core.citation.impl.*;
import org.uniprot.core.impl.CrossReferenceImpl;
import org.uniprot.core.impl.DefaultDatabase;
import org.uniprot.core.impl.ValueImpl;
import org.uniprot.core.json.parser.JsonConfig;
import org.uniprot.core.json.parser.deserializer.LocalDateDeserializer;
import org.uniprot.core.json.parser.serializer.AuthorSerializer;
import org.uniprot.core.json.parser.serializer.JournalSerializer;
import org.uniprot.core.json.parser.serializer.LocalDateSerializer;
import org.uniprot.core.json.parser.serializer.LocatorSerializer;
import org.uniprot.core.json.parser.serializer.PublicationDateSerializer;
import org.uniprot.core.json.parser.serializer.*;
import org.uniprot.core.json.parser.uniprot.serializer.UniProtKBAccessionSerializer;
import org.uniprot.core.proteome.*;
import org.uniprot.core.proteome.impl.*;
Expand All @@ -46,9 +24,7 @@
import org.uniprot.core.uniprotkb.taxonomy.Taxonomy;
import org.uniprot.core.uniprotkb.taxonomy.impl.TaxonomyImpl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.module.SimpleModule;
import java.time.LocalDate;

public class ProteomeJsonConfig extends JsonConfig {
private static ProteomeJsonConfig instance;
Expand Down Expand Up @@ -89,6 +65,7 @@ private ObjectMapper initObjectMapper() {
mod.addAbstractTypeMapping(ProteomeId.class, ProteomeIdImpl.class);
mod.addAbstractTypeMapping(Taxonomy.class, TaxonomyImpl.class);
mod.addAbstractTypeMapping(TaxonomyLineage.class, TaxonomyLineageImpl.class);
mod.addAbstractTypeMapping(ProteomeStatistics.class, ProteomeStatisticsImpl.class);

mod.addAbstractTypeMapping(Value.class, ValueImpl.class);
mod.addAbstractTypeMapping(RedundantProteome.class, RedundantProteomeImpl.class);
Expand Down

0 comments on commit f99e4f1

Please sign in to comment.