2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.protocol_plugin.openflow.core.internal;
11 import java.util.concurrent.atomic.AtomicLong;
13 import org.apache.commons.lang3.builder.EqualsBuilder;
14 import org.apache.commons.lang3.builder.HashCodeBuilder;
15 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
16 import org.openflow.protocol.OFMessage;
19 * This class describes an OpenFlow message with priority
21 class PriorityMessage {
24 final static AtomicLong seq = new AtomicLong();
27 public PriorityMessage(OFMessage msg, int priority) {
29 this.priority = priority;
30 this.seqNum = seq.getAndIncrement();
33 public OFMessage getMsg() {
37 public void setMsg(OFMessage msg) {
41 public int getPriority() {
45 public void setPriority(int priority) {
46 this.priority = priority;
50 public int hashCode() {
51 return HashCodeBuilder.reflectionHashCode(this);
55 public boolean equals(Object obj) {
56 return EqualsBuilder.reflectionEquals(this, obj);
60 public String toString() {
61 return "PriorityMessage[" + ReflectionToStringBuilder.toString(this)