public MatchesBuilder(Matches base) { this._aceType = base.getAceType(); if (base instanceof MatchesImpl) { MatchesImpl impl = (MatchesImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.Matches> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.acl.access.list.entries.ace.Matches>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
public MatchesBuilder(Matches base) { this._aceType = base.getAceType(); if (base instanceof MatchesImpl) { MatchesImpl impl = (MatchesImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<Matches> casted =(AugmentationHolder<Matches>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_aceType, other.getAceType())) { return false;
@Nonnull private static AclType fromAce(final Ace ace) { AclType result = null; final AceType aceType = ace.getMatches().getAceType(); if (aceType instanceof AceEth) { result = ETH; } else if (aceType instanceof AceIp) { final AceIpVersion aceIpVersion = ((AceIp) aceType).getAceIpVersion(); if (aceIpVersion instanceof AceIpv4) { result = IP4; } else { result = IP6; } } if (result == null) { throw new IllegalArgumentException(String.format("Not supported ace type %s", aceType)); } return result; } }
if (!Objects.equals(_aceType, other.getAceType())) { return false;
@Override public final void write(@Nonnull final InstanceIdentifier<?> id, @Nonnull final List<Ace> aces, @Nonnull final InputAclSetInterface request, @Nonnegative final int vlanTags) throws VppBaseCallException, WriteTimeoutException { final PacketHandling action = aces.stream().map(ace -> ace.getActions().getPacketHandling()).distinct() .collect(SINGLE_ITEM_COLLECTOR); checkArgument(vlanTags >= 0 && vlanTags <= 2, "Number of vlan tags %s is not in [0,2] range"); int nextTableIndex = -1; for (final Ace ace : aces) { // Create table + session per entry final ClassifyAddDelTable ctRequest = createClassifyTable(action, (T) ace.getMatches().getAceType(), nextTableIndex, vlanTags); nextTableIndex = createClassifyTable(id, ctRequest); createClassifySession(id, createClassifySession(action, (T) ace.getMatches().getAceType(), nextTableIndex, vlanTags)); } setClassifyTable(request, nextTableIndex); }
.flatMap(acl -> aclToAceStream(acl, writeContext)) .filter(ace -> ace != null && ace.getMatches() != null && ace.getMatches().getAceType() != null && ace.getActions() != null && ace.getActions().getPacketHandling() != null) .collect(Collectors.groupingBy(AclType::fromAce));