6bc4f1083b33918deb6b25b061ff9a1d49e8590b
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / internal / PriorityMessage.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.protocol_plugin.openflow.core.internal;
11
12 import org.apache.commons.lang3.builder.EqualsBuilder;
13 import org.apache.commons.lang3.builder.HashCodeBuilder;
14 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
15 import org.openflow.protocol.OFMessage;
16
17 /**
18  * This class describes an OpenFlow message with priority
19  */
20 class PriorityMessage {
21         OFMessage msg;
22         int priority;
23         
24         public PriorityMessage(OFMessage msg, int priority) {
25                 this.msg = msg;
26                 this.priority = priority;
27         }
28
29         public OFMessage getMsg() {
30                 return msg;
31         }
32
33         public void setMsg(OFMessage msg) {
34                 this.msg = msg;
35         }
36
37         public int getPriority() {
38                 return priority;
39         }
40
41         public void setPriority(int priority) {
42                 this.priority = priority;
43         }       
44         
45         @Override
46     public int hashCode() {
47         return HashCodeBuilder.reflectionHashCode(this);
48     }
49
50     @Override
51     public boolean equals(Object obj) {
52         return EqualsBuilder.reflectionEquals(this, obj);
53     }
54
55     @Override
56     public String toString() {
57         return "PriorityMessage[" + ReflectionToStringBuilder.toString(this) + "]";
58     }
59 }