tmf: Add generics to ITmfEventAspect
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / TmfEventTypeCollectionHelper.java
CommitLineData
409bea20
GB
1/*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
12
2bdf0193 13package org.eclipse.tracecompass.tmf.core.trace;
409bea20
GB
14
15import java.util.HashSet;
16import java.util.Set;
17
df2597e0 18import org.eclipse.jdt.annotation.NonNull;
2bdf0193 19import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
409bea20
GB
20
21/**
22 * Set Helper for sets of ITmfTraceType
23 *
24 * TODO Remove once Java 8 is used (replace with Streams)
25 *
26 * @author Matthew Khouzam
409bea20
GB
27 */
28public final class TmfEventTypeCollectionHelper {
29
30 private TmfEventTypeCollectionHelper() {
31 }
32
33 /**
34 * Gets the event names from a collection of event types
35 *
36 * @param eventTypes
37 * an iterable collection of ITmfEventTypes
38 * @return a set of the names of these events, if some names are clashing
39 * they will only appear once
40 */
df2597e0
AM
41 public static Set<@NonNull String> getEventNames(Iterable<@NonNull ? extends ITmfEventType> eventTypes) {
42 Set<@NonNull String> retSet = new HashSet<>();
409bea20
GB
43 for (ITmfEventType eventType : eventTypes) {
44 retSet.add(eventType.getName());
45 }
46 return retSet;
47 }
48}
This page took 0.063821 seconds and 5 git commands to generate.