2 * Copyright © 2017 Red Hat, Inc. and others.
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
8 package org.opendaylight.genius.mdsalutil.matches;
10 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.arp.match.fields.ArpTargetHardwareAddressBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatchBuilder;
17 * ARP target hardware address match.
19 public class MatchArpTha extends MatchInfoHelper<ArpMatch, ArpMatchBuilder> {
20 private final MacAddress address;
22 public MatchArpTha(MacAddress address) {
23 this.address = address;
27 protected void applyValue(MatchBuilder matchBuilder, ArpMatch value) {
28 matchBuilder.setLayer3Match(value);
32 protected void populateBuilder(ArpMatchBuilder builder) {
33 builder.setArpTargetHardwareAddress(new ArpTargetHardwareAddressBuilder().setAddress(address).build());
36 public MacAddress getAddress() {
41 public boolean equals(Object other) {
45 if (other == null || getClass() != other.getClass()) {
48 if (!super.equals(other)) {
52 MatchArpTha that = (MatchArpTha) other;
54 return address != null ? address.equals(that.address) : that.address == null;
58 public int hashCode() {
59 int result = super.hashCode();
60 result = 31 * result + (address != null ? address.hashCode() : 0);