2 * Copyright (c) 2015 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.openflowplugin.impl.flow.registry;
11 import org.opendaylight.openflowplugin.api.openflow.flow.registry.FlowHash;
12 import org.opendaylight.openflowplugin.impl.util.HashUtil;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;
17 * Created by Martin Bobak <mbobak@cisco.com> on 8.4.2015.
19 public class FlowHashDto implements FlowHash {
21 private long hashCode;
23 public FlowHashDto(Flow flow) {
27 private long calculateHash(Flow flow) {
29 Match match = flow.getMatch();
30 hash = HashUtil.calculateMatchHash(match);
31 hash += flow.getPriority();
32 hash += flow.getTableId();
33 hash += flow.getCookie().hashCode();
39 public boolean equals(final Object obj) {
40 if (!(obj instanceof FlowHash)) {
43 if (this.hashCode == ((FlowHash) obj).getHash()) {
50 public long getHash() {