@Test public void convert() { AffMatchDocumentProject result = converter.convert(new DocumentToProject(docId, projId, confidenceLevel, null)); assertEquals(docId, result.getDocumentId()); assertEquals(projId, result.getProjectId()); assertEquals(confidenceLevel, result.getConfidenceLevel(), 0); }
public AffMatchDocumentProject convert(DocumentToProject documentProject) { Preconditions.checkNotNull(documentProject); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getDocumentId())); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getProjectId())); Preconditions.checkArgument(documentProject.getConfidenceLevel() >= 0 && documentProject.getConfidenceLevel() <= 1); return new AffMatchDocumentProject(documentProject.getDocumentId().toString(), documentProject.getProjectId().toString(), documentProject.getConfidenceLevel()); }
InferredDocumentProjectConverter implements Serializable { public AffMatchDocumentProject convert(DocumentToProject documentProject) { Preconditions.checkNotNull(documentProject); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getDocumentId())); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getProjectId())); Preconditions.checkArgument(documentProject.getConfidenceLevel() >= 0 && documentProject.getConfidenceLevel() <= 1); return new AffMatchDocumentProject(documentProject.getDocumentId().toString(), documentProject.getProjectId().toString(), documentProject.getConfidenceLevel()); } }
InferredDocumentProjectConverter implements Serializable { public AffMatchDocumentProject convert(DocumentToProject documentProject) { Preconditions.checkNotNull(documentProject); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getDocumentId())); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getProjectId())); Preconditions.checkArgument(documentProject.getConfidenceLevel() >= 0 && documentProject.getConfidenceLevel() <= 1); return new AffMatchDocumentProject(documentProject.getDocumentId().toString(), documentProject.getProjectId().toString(), documentProject.getConfidenceLevel()); }  }
InferredDocumentProjectConverter implements Serializable { public AffMatchDocumentProject convert(DocumentToProject documentProject) { Preconditions.checkNotNull(documentProject); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getDocumentId())); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getProjectId())); Preconditions.checkArgument(documentProject.getConfidenceLevel() >= 0 && documentProject.getConfidenceLevel() <= 1); return new AffMatchDocumentProject(documentProject.getDocumentId().toString(), documentProject.getProjectId().toString(), documentProject.getConfidenceLevel()); }  AffMatchDocumentProject convert(DocumentToProject documentProject); }
InferredDocumentProjectConverter implements Serializable { public AffMatchDocumentProject convert(DocumentToProject documentProject) { Preconditions.checkNotNull(documentProject); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getDocumentId())); Preconditions.checkArgument(StringUtils.isNotBlank(documentProject.getProjectId())); Preconditions.checkArgument(documentProject.getConfidenceLevel() >= 0 && documentProject.getConfidenceLevel() <= 1); return new AffMatchDocumentProject(documentProject.getDocumentId().toString(), documentProject.getProjectId().toString(), documentProject.getConfidenceLevel()); }  AffMatchDocumentProject convert(DocumentToProject documentProject);  }