private NamingContextImpl(NamingContextBuilder base) { if (base.getKey() == null) { this._key = new NamingContextKey( base.getName() ); this._name = base.getName(); } else { this._key = base.getKey(); this._name = _key.getName(); } this._mappings = base.getMappings(); 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.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext>>, Augmentation<org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext>>, Augmentation<org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public NamingContextBuilder(NamingContext base) { if (base.key() == null) { this.key = new NamingContextKey( base.getName() ); this._name = base.getName(); } else { this.key = base.key(); this._name = key.getName(); } this._mappings = base.getMappings(); if (base instanceof NamingContextImpl) { NamingContextImpl impl = (NamingContextImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<NamingContext> casted =(AugmentationHolder<NamingContext>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
public NamingContextBuilder(NamingContext base) { if (base.getKey() == null) { this._key = new NamingContextKey( base.getName() ); this._name = base.getName(); } else { this._key = base.getKey(); this._name = _key.getName(); } this._mappings = base.getMappings(); if (base instanceof NamingContextImpl) { NamingContextImpl impl = (NamingContextImpl) 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.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private NamingContextImpl(NamingContextBuilder base) { if (base.key() == null) { this.key = new NamingContextKey( base.getName() ); this._name = base.getName(); } else { this.key = base.key(); this._name = key.getName(); } this._mappings = base.getMappings(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }