Bug 2065 - Unset fields in MeterStatsResponseConvertor
[openflowplugin.git] / openflowplugin / src / test / java / org / opendaylight / openflowplugin / openflow / md / core / plan / SwitchTestNotificationEventImpl.java
1 /**
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.openflow.md.core.plan;
10
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
12 import org.opendaylight.yangtools.yang.binding.Notification;
13
14 /**
15  * @author mirehak
16  */
17 public class SwitchTestNotificationEventImpl implements
18         SwitchTestNotificationEvent {
19
20     private Notification notification;
21
22     /**
23      * @param notification
24      *            the notification to set
25      */
26     public void setNotification(Notification notification) {
27         this.notification = notification;
28     }
29
30     @Override
31     public Notification getPlannedNotification() {
32         return notification;
33     }
34
35     @Override
36     public String toString() {
37         StringBuffer sb = new StringBuffer("SwitchTestNotificationEventImpl [notification=");
38         if (notification instanceof OfHeader) {
39             OfHeader header = (OfHeader) notification;
40             sb.append("version:").append(header.getVersion()).append(";")
41                 .append("xid:").append(header.getXid()).append(";")
42                 .append("type:").append(header.getClass().getSimpleName());
43         } else {
44             sb.append(notification.toString());
45         }
46         sb.append("]");
47         return sb.toString();
48     }
49 }