citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/chartfactory/impl/AbstractGhantChartManagerImpl.java
private Gantt createGenericGantt(final List<T> assignmentList, final Function<T, String> roleMapping,
			final StepMapping<T> stepMapping) {

		final Map<String, List<T>> assignmentListMap = assignmentList.stream()
				.collect(Collectors.groupingBy(roleMapping, TreeMap::new, Collectors.toList()));

		final Gantt gantt = createGantt();

		if (!assignmentList.isEmpty()) {

			gantt.setStartDate(stepMapping.getFromDate(assignmentList.get(0)));
			gantt.setEndDate(
					stripDatesAfterCurrentDate(stepMapping.getToDate(assignmentList.get(assignmentList.size() - 1))));

			for (final Entry<String, List<T>> entry : entriesSortedByValues(assignmentListMap, stepMapping)) {

				final String stepName = entry.getKey();

				final Step step = new Step(stepName,CaptionMode.HTML);
				step.setDescription(stepName);

				final List<T> assignments = entry.getValue();

				Collections.sort(assignments, getComparator());

				addViewGenericRoleMemberToStep(stepName, step, assignments, stepMapping);

				gantt.addStep(step);
			}
		}

		return gantt;
	}
private Gantt createGenericGantt(final List<T> assignmentList, final Function<T, String> roleMapping,
			final StepMapping<T> stepMapping) {

		final Map<String, List<T>> assignmentListMap = assignmentList.stream()
				.collect(Collectors.groupingBy(roleMapping, TreeMap::new, Collectors.toList()));

		final Gantt gantt = createGantt();

		if (!assignmentList.isEmpty()) {

			gantt.setStartDate(stepMapping.getFromDate(assignmentList.get(0)));
			gantt.setEndDate(
					stripDatesAfterCurrentDate(stepMapping.getToDate(assignmentList.get(assignmentList.size() - 1))));

			for (final Entry<String, List<T>> entry : entriesSortedByValues(assignmentListMap, stepMapping)) {

				final String stepName = entry.getKey();

				final Step step = new Step(stepName,CaptionMode.HTML);
				step.setDescription(stepName);

				final List<T> assignments = entry.getValue();

				Collections.sort(assignments, getComparator());

				addViewGenericRoleMemberToStep(stepName, step, assignments, stepMapping);

				gantt.addStep(step);
			}
		}

		return gantt;
	}
private Gantt createGenericGantt ( final List < T > assignmentList , final Function < T , String > roleMapping , final StepMapping < T > stepMapping ) { final Map < String , List < T > > assignmentListMap = assignmentList . stream ( ) . collect ( Collectors . groupingBy ( roleMapping , TreeMap :: new , Collectors . toList ( ) ) ) ; final Gantt gantt = createGantt ( ) ; if ( ! assignmentList . isEmpty ( ) ) { gantt . setStartDate ( stepMapping . getFromDate ( assignmentList . get ( 0 ) ) ) ; gantt . setEndDate ( stripDatesAfterCurrentDate ( stepMapping . getToDate ( assignmentList . get ( assignmentList . size ( ) - 1 ) ) ) ) ; for ( final Entry < String , List < T > > entry : entriesSortedByValues ( assignmentListMap , stepMapping ) ) { final String stepName = entry . getKey ( ) ; final Step step = new Step ( stepName , CaptionMode . HTML ) ; step . setDescription ( stepName ) ; final List < T > assignments = entry . getValue ( ) ; Collections . sort ( assignments , getComparator ( ) ) ; addViewGenericRoleMemberToStep ( stepName , step , assignments , stepMapping ) ; gantt . addStep ( step ) ; } } return gantt ; }
Creates the generic gantt.

@param assignmentList
the assignment list
@param roleMapping
the role mapping
@param stepMapping
the step mapping
@return the gantt
Creates the generic gantt .