@Test public void convert() { eu.dnetlib.iis.citationmatching.schemas.Citation inputCitation = eu.dnetlib.iis.citationmatching.schemas.Citation.newBuilder() .setSourceDocumentId("source-id") .setDestinationDocumentId("dest-id") .setPosition(4) .setConfidenceLevel(0.73f) .build(); Citation retCitation = converter.convert(inputCitation); Citation expectedCitation = Citation.newBuilder() .setSourceDocumentId("source-id") .setEntry(CitationEntry.newBuilder() .setPosition(4) .setDestinationDocumentId("dest-id") .setConfidenceLevel(0.73f) .setRawText(null) .setExternalDestinationDocumentIds(Maps.newHashMap()) .build()) .build(); assertEquals(expectedCitation, retCitation); }
public eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation) { Preconditions.checkNotNull(inputCitation); CitationEntry citationEntry = CitationEntry.newBuilder() .setPosition(inputCitation.getPosition()) .setDestinationDocumentId(inputCitation.getDestinationDocumentId()) .setConfidenceLevel(inputCitation.getConfidenceLevel()) .setExternalDestinationDocumentIds(Maps.newHashMap()) .build(); return eu.dnetlib.iis.common.citations.schemas.Citation.newBuilder() .setSourceDocumentId(inputCitation.getSourceDocumentId()) .setEntry(citationEntry) .build(); }
CitationToCommonCitationConverter { public eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation) { Preconditions.checkNotNull(inputCitation); CitationEntry citationEntry = CitationEntry.newBuilder() .setPosition(inputCitation.getPosition()) .setDestinationDocumentId(inputCitation.getDestinationDocumentId()) .setConfidenceLevel(inputCitation.getConfidenceLevel()) .setExternalDestinationDocumentIds(Maps.newHashMap()) .build(); return eu.dnetlib.iis.common.citations.schemas.Citation.newBuilder() .setSourceDocumentId(inputCitation.getSourceDocumentId()) .setEntry(citationEntry) .build(); } }
CitationToCommonCitationConverter { public eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation) { Preconditions.checkNotNull(inputCitation); CitationEntry citationEntry = CitationEntry.newBuilder() .setPosition(inputCitation.getPosition()) .setDestinationDocumentId(inputCitation.getDestinationDocumentId()) .setConfidenceLevel(inputCitation.getConfidenceLevel()) .setExternalDestinationDocumentIds(Maps.newHashMap()) .build(); return eu.dnetlib.iis.common.citations.schemas.Citation.newBuilder() .setSourceDocumentId(inputCitation.getSourceDocumentId()) .setEntry(citationEntry) .build(); }  }
CitationToCommonCitationConverter { public eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation) { Preconditions.checkNotNull(inputCitation); CitationEntry citationEntry = CitationEntry.newBuilder() .setPosition(inputCitation.getPosition()) .setDestinationDocumentId(inputCitation.getDestinationDocumentId()) .setConfidenceLevel(inputCitation.getConfidenceLevel()) .setExternalDestinationDocumentIds(Maps.newHashMap()) .build(); return eu.dnetlib.iis.common.citations.schemas.Citation.newBuilder() .setSourceDocumentId(inputCitation.getSourceDocumentId()) .setEntry(citationEntry) .build(); }  eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation); }
CitationToCommonCitationConverter { public eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation) { Preconditions.checkNotNull(inputCitation); CitationEntry citationEntry = CitationEntry.newBuilder() .setPosition(inputCitation.getPosition()) .setDestinationDocumentId(inputCitation.getDestinationDocumentId()) .setConfidenceLevel(inputCitation.getConfidenceLevel()) .setExternalDestinationDocumentIds(Maps.newHashMap()) .build(); return eu.dnetlib.iis.common.citations.schemas.Citation.newBuilder() .setSourceDocumentId(inputCitation.getSourceDocumentId()) .setEntry(citationEntry) .build(); }  eu.dnetlib.iis.common.citations.schemas.Citation convert(Citation inputCitation);  }