tmf: lttngControl: ProbeEventInfo: add constructor from EventInfo
authorJonathan Rajotte Julien <jonathan.rajotte-julien@ericsson.com>
Tue, 5 Aug 2014 20:11:49 +0000 (16:11 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Wed, 27 Aug 2014 15:32:49 +0000 (11:32 -0400)
Fix style issues at the same time

Change-Id: Ie329b9b4c0224785251d39b27b59c31d2397d137
Signed-off-by: Jonathan Rajotte Julien <jonathan.rajotte-julien@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/31067
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
org.eclipse.linuxtools.lttng2.control.core/src/org/eclipse/linuxtools/internal/lttng2/control/core/model/impl/ProbeEventInfo.java

index 87f40a954f11992301205cce88fab8fba0c16615..357c509f4a252bf929f3bc8bd6d2d6f5fb3e7d58 100644 (file)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2012, 2013 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -9,18 +9,18 @@
  * Contributors:
  *   Bernd Hufmann - Initial API and implementation
  **********************************************************************/
+
 package org.eclipse.linuxtools.internal.lttng2.control.core.model.impl;
 
+import org.eclipse.linuxtools.internal.lttng2.control.core.model.IEventInfo;
 import org.eclipse.linuxtools.internal.lttng2.control.core.model.IProbeEventInfo;
 
 /**
-* <p>
-* Implementation of the trace event interface (IProbeEventInfo) to store probe event
-* related data.
-* </p>
-*
-* @author Bernd Hufmann
-*/
+ * Implementation of the trace event interface (IProbeEventInfo) to store probe
+ * event related data.
+ *
+ * @author Bernd Hufmann
+ */
 public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
 
     // ------------------------------------------------------------------------
@@ -40,13 +40,14 @@ public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
      */
     private String fSymbol;
 
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
     /**
      * Constructor
-     * @param name - name of event
+     *
+     * @param name
+     *            - name of event
      */
     public ProbeEventInfo(String name) {
         super(name);
@@ -54,7 +55,9 @@ public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
 
     /**
      * Copy constructor
-     * @param other - the instance to copy
+     *
+     * @param other
+     *            - the instance to copy
      */
     public ProbeEventInfo(ProbeEventInfo other) {
         super(other);
@@ -63,6 +66,20 @@ public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
         fSymbol = other.fSymbol;
     }
 
+    /**
+     * Constructor from a {@link IEventInfo}
+     *
+     * @param eventInfo
+     *            - the instance to copy
+     */
+    public ProbeEventInfo(IEventInfo eventInfo) {
+        super(eventInfo.getName());
+        setState(eventInfo.getState());
+        setLogLevelType(eventInfo.getLogLevelType());
+        setLogLevel(eventInfo.getLogLevel());
+        setFilterExpression(eventInfo.getFilterExpression());
+    }
+
     // ------------------------------------------------------------------------
     // Accessors
     // ------------------------------------------------------------------------
@@ -151,19 +168,19 @@ public class ProbeEventInfo extends EventInfo implements IProbeEventInfo {
     @Override
     public String toString() {
         StringBuffer output = new StringBuffer();
-            output.append("[ProbeEventInfo(");
-            output.append(super.toString());
-            if (fAddress != null) {
-                output.append(",fAddress=");
-                output.append(fAddress);
-            } else {
-                output.append(",fOffset=");
-                output.append(fOffset);
-                output.append(",fSymbol=");
-                output.append(fSymbol);
-            }
-            output.append(")]");
-            return output.toString();
+        output.append("[ProbeEventInfo(");
+        output.append(super.toString());
+        if (fAddress != null) {
+            output.append(",fAddress=");
+            output.append(fAddress);
+        } else {
+            output.append(",fOffset=");
+            output.append(fOffset);
+            output.append(",fSymbol=");
+            output.append(fSymbol);
+        }
+        output.append(")]");
+        return output.toString();
     }
 
 }
This page took 0.026745 seconds and 5 git commands to generate.