Code example for TimeUnit

Methods: toHours

0
	@Override 
	public String getText(Object element) {
		if (element instanceof ITicket) {
			final ITicket entry = (ITicket) element;
			final Long worktime = entry.getWorktime();
			return "Ticket: " + entry.getEmployeeName() + ", " + TimeUnit.MILLISECONDS.toHours(worktime) + " h";
		} else if (element instanceof IStory) {
			final IStory entry = (IStory) element;
			return "Story: " + entry.getName();
		} else if (element instanceof ISprint) {
			final ISprint entry = (ISprint) element;
			return "Sprint: " + entry.getName();
		} else if (element instanceof IProject) {
			final IProject entry = (IProject) element;
			return "Project: " + entry.getName();
		} else { 
			return "?"; 
		} 
	} 
}