@Test public void testCaseInstanceMapper_mapNull() { final CaseInstance ci = null; final CaseInstanceSummary cis = new CaseInstanceMapper().apply(ci); assertNull(cis); }
@Override public CaseInstanceSummary apply(final CaseInstance ci) { if (ci == null) { return null; } return CaseInstanceSummary.builder(). caseId(ci.getCaseId()). description(ci.getCaseDescription()). status(CaseStatus.fromId(ci.getCaseStatus())). containerId(ci.getContainerId()). owner(ci.getCaseOwner()). startedAt(ci.getStartedAt()). completedAt(ci.getCompletedAt()). caseDefinitionId(ci.getCaseDefinitionId()). roleAssignments( ofNullable(ci.getRoleAssignments()).orElse(emptyList()) .stream() .map(new RoleAssignmentsMapper()) .collect(toList())). stages( ofNullable(ci.getStages()).orElse(emptyList()) .stream() .map(new CaseStageMapper()) .collect(toList())). build(); }
CaseInstanceMapper implements Function<CaseInstance, CaseInstanceSummary> { @Override public CaseInstanceSummary apply(final CaseInstance ci) { if (ci == null) { return null; } return CaseInstanceSummary.builder(). caseId(ci.getCaseId()). description(ci.getCaseDescription()). status(CaseStatus.fromId(ci.getCaseStatus())). containerId(ci.getContainerId()). owner(ci.getCaseOwner()). startedAt(ci.getStartedAt()). completedAt(ci.getCompletedAt()). caseDefinitionId(ci.getCaseDefinitionId()). roleAssignments( ofNullable(ci.getRoleAssignments()).orElse(emptyList()) .stream() .map(new RoleAssignmentsMapper()) .collect(toList())). stages( ofNullable(ci.getStages()).orElse(emptyList()) .stream() .map(new CaseStageMapper()) .collect(toList())). build(); } }
CaseInstanceMapper implements Function<CaseInstance, CaseInstanceSummary> { @Override public CaseInstanceSummary apply(final CaseInstance ci) { if (ci == null) { return null; } return CaseInstanceSummary.builder(). caseId(ci.getCaseId()). description(ci.getCaseDescription()). status(CaseStatus.fromId(ci.getCaseStatus())). containerId(ci.getContainerId()). owner(ci.getCaseOwner()). startedAt(ci.getStartedAt()). completedAt(ci.getCompletedAt()). caseDefinitionId(ci.getCaseDefinitionId()). roleAssignments( ofNullable(ci.getRoleAssignments()).orElse(emptyList()) .stream() .map(new RoleAssignmentsMapper()) .collect(toList())). stages( ofNullable(ci.getStages()).orElse(emptyList()) .stream() .map(new CaseStageMapper()) .collect(toList())). build(); }  }
CaseInstanceMapper implements Function<CaseInstance, CaseInstanceSummary> { @Override public CaseInstanceSummary apply(final CaseInstance ci) { if (ci == null) { return null; } return CaseInstanceSummary.builder(). caseId(ci.getCaseId()). description(ci.getCaseDescription()). status(CaseStatus.fromId(ci.getCaseStatus())). containerId(ci.getContainerId()). owner(ci.getCaseOwner()). startedAt(ci.getStartedAt()). completedAt(ci.getCompletedAt()). caseDefinitionId(ci.getCaseDefinitionId()). roleAssignments( ofNullable(ci.getRoleAssignments()).orElse(emptyList()) .stream() .map(new RoleAssignmentsMapper()) .collect(toList())). stages( ofNullable(ci.getStages()).orElse(emptyList()) .stream() .map(new CaseStageMapper()) .collect(toList())). build(); }  @Override CaseInstanceSummary apply(final CaseInstance ci); }
CaseInstanceMapper implements Function<CaseInstance, CaseInstanceSummary> { @Override public CaseInstanceSummary apply(final CaseInstance ci) { if (ci == null) { return null; } return CaseInstanceSummary.builder(). caseId(ci.getCaseId()). description(ci.getCaseDescription()). status(CaseStatus.fromId(ci.getCaseStatus())). containerId(ci.getContainerId()). owner(ci.getCaseOwner()). startedAt(ci.getStartedAt()). completedAt(ci.getCompletedAt()). caseDefinitionId(ci.getCaseDefinitionId()). roleAssignments( ofNullable(ci.getRoleAssignments()).orElse(emptyList()) .stream() .map(new RoleAssignmentsMapper()) .collect(toList())). stages( ofNullable(ci.getStages()).orElse(emptyList()) .stream() .map(new CaseStageMapper()) .collect(toList())). build(); }  @Override CaseInstanceSummary apply(final CaseInstance ci);  }