Fix checkstyle warnings
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / md / core / NotificationQueueWrapper.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.openflowplugin.api.openflow.md.core;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
12 import org.opendaylight.yangtools.yang.binding.DataContainer;
13 import org.opendaylight.yangtools.yang.binding.Notification;
14
15 public class NotificationQueueWrapper implements OfHeader {
16
17     private final Notification notification;
18     private final Short version;
19     private Long xid = -1L;
20
21
22     /**
23      * Notofication queue wrapper.
24      * @param notification notofication
25      * @param version version
26      */
27     public NotificationQueueWrapper(final Notification notification, final Short version) {
28         Preconditions.checkArgument(notification != null, "wrapped notification must not be null");
29         Preconditions.checkArgument(version != null, "message version of wrapped notification must not be null");
30         this.notification = notification;
31         this.version = version;
32     }
33
34     @Override
35     public Class<? extends DataContainer> getImplementedInterface() {
36         return NotificationQueueWrapper.class;
37     }
38
39     @Override
40     public Short getVersion() {
41         return version;
42     }
43
44     @Override
45     public Long getXid() {
46         return xid;
47     }
48
49     /**
50      * return the notification.
51      */
52     public Notification getNotification() {
53         return notification;
54     }
55
56     /**
57      * Setter.
58      * @param xid the xid to set
59      */
60     public void setXid(Long xid) {
61         this.xid = xid;
62     }
63 }