private AclImpl(AclBuilder base) { if (base.key() == null) { this.key = new AclKey( base.getAclName(), base.getAclType() ); this._aclName = base.getAclName(); this._aclType = base.getAclType(); } else { this.key = base.key(); this._aclName = key.getAclName(); this._aclType = key.getAclType(); } this._accessListEntries = base.getAccessListEntries(); this._aclOperData = base.getAclOperData(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
public AclBuilder addAugmentation(Class<? extends Augmentation<Acl>> augmentationType, Augmentation<Acl> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; }
@Nonnull @Override public AclBuilder getBuilder(@Nonnull final InstanceIdentifier<Acl> id) { return new AclBuilder(); }
private AclImpl(AclBuilder base) { if (base.getKey() == null) { this._key = new AclKey( base.getAclName(), base.getAclType() ); this._aclName = base.getAclName(); this._aclType = base.getAclType(); } else { this._key = base.getKey(); this._aclName = _key.getAclName(); this._aclType = _key.getAclType(); } this._accessListEntries = base.getAccessListEntries(); this._aclOperData = base.getAclOperData(); 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.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
@Nonnull final ReadContext ctx) throws ReadFailedException { final AclKey key = id.firstKeyOf(Acl.class); builder.withKey(key); final Class<? extends AclBase> aclType = key.getAclType(); final String name = key.getAclName(); final AclDetails aclDetails = detail.get(); setTag(builder, aclDetails.tag); builder.setAccessListEntries(new AccessListEntriesBuilder() .setAce(toStandardAces(name, aclDetails.r, standardAclContext, ctx.getMappingContext())) .build()); setTag(builder, macipAclDetails.tag); if (detail.isPresent()) { builder.setAccessListEntries(new AccessListEntriesBuilder() .setAce(toMacIpAces(name, macipAclDetails.r, macipAclContext, ctx.getMappingContext())) .build());
private void setTag(@Nonnull final AclBuilder builder, @Nullable final byte[] tag) { if (tag != null) { final String strTag = toString(tag); if (strTag.length() > 0) { builder.addAugmentation( VppAclAugmentation.class, new VppAclAugmentationBuilder().setTag(strTag).build() ); } } } }
public AclBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }