private MatchImpl(MatchBuilder base) { this._ethernetMatch = base.getEthernetMatch(); this._icmpv4Match = base.getIcmpv4Match(); this._icmpv6Match = base.getIcmpv6Match(); this._inPhyPort = base.getInPhyPort(); this._inPort = base.getInPort(); this._ipMatch = base.getIpMatch(); this._layer3Match = base.getLayer3Match(); this._layer4Match = base.getLayer4Match(); this._metadata = base.getMetadata(); this._protocolMatchFields = base.getProtocolMatchFields(); this._tcpFlagMatch = base.getTcpFlagMatch(); this._tunnel = base.getTunnel(); this._vlanMatch = base.getVlanMatch(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
private static Ipv4Match mergeIpv4Match(MatchBuilder match, Ipv4MatchBuilder ipMatchBuilder) { Ipv4Match ipv4Match = (Ipv4Match) match.getLayer3Match(); if(ipv4Match == null) { return ipMatchBuilder.build(); } if(ipv4Match.getIpv4Destination() != null) { ipMatchBuilder.setIpv4Destination(ipv4Match.getIpv4Destination()); } if(ipv4Match.getIpv4Source() != null) { ipMatchBuilder.setIpv4Source(ipv4Match.getIpv4Source()); } return ipMatchBuilder.build(); }
private static Ipv6Match mergeIpv6Match(MatchBuilder match, Ipv6MatchBuilder ipMatchBuilder) { Ipv6Match ipv6Match = (Ipv6Match) match.getLayer3Match(); if(ipv6Match == null) { return ipMatchBuilder.build(); } if(ipv6Match.getIpv6Destination() != null) { ipMatchBuilder.setIpv6Destination(ipv6Match.getIpv6Destination()); } if(ipv6Match.getIpv6Source() != null) { ipMatchBuilder.setIpv6Source(ipv6Match.getIpv6Source()); } return ipMatchBuilder.build(); }