@Test(expected = IllegalArgumentException.class) public void convert_null_document_id() { converter.convert(new DocumentToProject(null, projId, confidenceLevel, null)); }
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);  }