public InterfacesBuilder(Interfaces base) { this._interface = base.getInterface(); if (base instanceof InterfacesImpl) { InterfacesImpl impl = (InterfacesImpl) 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.interfaces.rev140508.Interfaces> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (other.getInterface() != null) { return false; } else if(!_interface.equals(other.getInterface())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
if (!Objects.equals(_interface, other.getInterface())) { return false; if (!e.getValue().equals(other.augmentation(e.getKey()))) { return false;
public InterfacesBuilder(Interfaces base) { this._interface = base.getInterface(); if (base instanceof InterfacesImpl) { InterfacesImpl impl = (InterfacesImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") Map<Class<? extends Augmentation<Interfaces>>, Augmentation<Interfaces>> aug =((AugmentationHolder<Interfaces>) base).augmentations(); if (!aug.isEmpty()) { this.augmentation = new HashMap<>(aug); } } }
if (!Objects.equals(_interface, other.getInterface())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
public InterfacesBuilder(Interfaces base) { this._interface = base.getInterface(); if (base instanceof InterfacesImpl) { InterfacesImpl impl = (InterfacesImpl) 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.interfaces.rev140508.Interfaces> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
/** * @return <code>java.util.List</code> <code>interface</code>, or an empty list if it is not present */ default @NonNull List<Interface> nonnullInterface() { return CodeHelpers.nonnull(getInterface()); }
private static boolean isAssigned(@Nonnull final Acl acl, @Nonnull final WriteContext writeContext) { final String aclName = acl.getAclName(); final Class<? extends AclBase> aclType = acl.getAclType(); final Interfaces interfaces = writeContext.readAfter(InstanceIdentifier.create(Interfaces.class)).get(); return interfaces.getInterface().stream() .map(i -> Optional.ofNullable(i.getAugmentation(VppInterfaceAugmentation.class)) .map(aug -> aug.getIetfAcl()) .map(ietfAcl -> ietfAcl.getAccessLists()) .map(accessLists -> accessLists.getAcl()) ) .flatMap(iacl -> iacl.isPresent() ? iacl.get().stream() : Stream.empty()) .filter(assignedAcl -> aclName.equals(assignedAcl.getName()) && aclType.equals(assignedAcl.getType())) .findFirst().isPresent(); } }
@Nonnull final Acl acl) { final Optional<Interfaces> readAfter = writeContext.readAfter(InstanceIdentifier.create(Interfaces.class)); if (!readAfter.isPresent() || readAfter.get().getInterface() == null) { return Collections.emptyList(); final List<Interface> interfaces = readAfter.get().getInterface(); final Class<? extends AclBase> aclType = acl.getAclType(); final String aclName = acl.getAclName();
@Override public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<BridgeDomain> id, @Nonnull final BridgeDomain dataBefore, @Nonnull final WriteContext ctx) throws WriteFailedException { LOG.debug("deleteCurrentAttributes: id={}, dataBefore={}, ctx={}", id, dataBefore, ctx); final String bdName = id.firstKeyOf(BridgeDomain.class).getName(); final com.google.common.base.Optional<Interfaces> after = ctx.readAfter(InstanceIdentifier.create(Interfaces.class)); if (after.isPresent()) { checkReferenceExist(id, Optional.ofNullable(after.get().getInterface()) .orElse(Collections.emptyList()) .stream() .map(iface -> Optional.ofNullable(iface.augmentation(VppInterfaceAugmentation.class)) .map(VppInterfaceAugmentation::getL2) .map(L2ConfigAttributes::getInterconnection) .orElse(null)) .filter(interconnection -> interconnection instanceof BridgeBased) .map(BridgeBased.class::cast) .filter(bridgeBased -> bdName.equals(bridgeBased.getBridgeDomain())) .collect(toList())); } int bdId = bdContext.getIndex(bdName, ctx.getMappingContext()); final BridgeDomainAddDel request = new BridgeDomainAddDel(); request.bdId = bdId; getReplyForWrite(getFutureJVpp().bridgeDomainAddDel(request).toCompletableFuture(), id); LOG.debug("Bridge domain {} (id={}) deleted successfully", bdName, bdId); }
.Interface> inters = interfaces.getInterface();