tmf: Do not define base aspects in the interface
[deliverable/tracecompass.git] / btf / org.eclipse.tracecompass.btf.core / src / org / eclipse / tracecompass / btf / core / trace / BtfEventAspects.java
index 873793c253ebef28592fcbc11656f100ff74a1d9..443e5eea221d5ac8e65914248308f05520fb4329 100644 (file)
 
 package org.eclipse.tracecompass.btf.core.trace;
 
-import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.btf.core.event.BtfEvent;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.event.aspect.TmfBaseAspects;
 import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
 import org.eclipse.tracecompass.tmf.core.event.aspect.TmfContentFieldAspect;
 
@@ -28,26 +29,27 @@ import com.google.common.collect.ImmutableList;
  *
  * @author Alexandre Montplaisir
  */
+@NonNullByDefault
 public final class BtfEventAspects {
 
     private BtfEventAspects() {}
 
-    private static final @NonNull Iterable<ITmfEventAspect> BTF_ASPECTS =
-            NonNullUtils.checkNotNull(ImmutableList.of(
-                    ITmfEventAspect.BaseAspects.TIMESTAMP,
+    private static final Iterable<ITmfEventAspect<?>> BTF_ASPECTS =
+            ImmutableList.of(
+                    TmfBaseAspects.getTimestampAspect(),
                     new BtfSourceAspect(),
                     new TmfContentFieldAspect(BtfColumnNames.SOURCE_INSTANCE.toString(), BtfColumnNames.SOURCE_INSTANCE.toString()),
-                    ITmfEventAspect.BaseAspects.EVENT_TYPE,
+                    TmfBaseAspects.getEventTypeAspect(),
                     new BtfTargetAspect(),
                     new TmfContentFieldAspect(BtfColumnNames.TARGET_INSTANCE.toString(), BtfColumnNames.TARGET_INSTANCE.toString()),
                     new TmfContentFieldAspect(BtfColumnNames.EVENT.toString(), BtfColumnNames.EVENT.toString()),
                     new TmfContentFieldAspect(BtfColumnNames.NOTES.toString(), BtfColumnNames.NOTES.toString())
-                    ));
+                    );
 
     /**
      * The "source" aspect, whose value comes from {@link ITmfEvent#getSource()}
      */
-    private static class BtfSourceAspect implements ITmfEventAspect {
+    private static class BtfSourceAspect implements ITmfEventAspect<String> {
 
         @Override
         public String getName() {
@@ -60,7 +62,7 @@ public final class BtfEventAspects {
         }
 
         @Override
-        public String resolve(ITmfEvent event) {
+        public @Nullable String resolve(ITmfEvent event) {
             if (!(event instanceof BtfEvent)) {
                 return EMPTY_STRING;
             }
@@ -73,7 +75,7 @@ public final class BtfEventAspects {
      * The "target" aspect, taking its value from
      * {@link ITmfEvent#getTarget()}.
      */
-    private static class BtfTargetAspect implements ITmfEventAspect {
+    private static class BtfTargetAspect implements ITmfEventAspect<String> {
 
         @Override
         public String getName() {
@@ -86,7 +88,7 @@ public final class BtfEventAspects {
         }
 
         @Override
-        public String resolve(ITmfEvent event) {
+        public @Nullable String resolve(ITmfEvent event) {
             if (!(event instanceof BtfEvent)) {
                 return EMPTY_STRING;
             }
@@ -100,7 +102,7 @@ public final class BtfEventAspects {
      *
      * @return The aspects
      */
-    public static @NonNull Iterable<ITmfEventAspect> getAspects() {
+    public static Iterable<ITmfEventAspect<?>> getAspects() {
         return BTF_ASPECTS;
     }
 }
\ No newline at end of file
This page took 0.027634 seconds and 5 git commands to generate.