public NshEntryBuilder setNsi(final java.lang.Short value) { if (value != null) { checkNsiRange(value); } this._nsi = value; return this; }
public NshEntryBuilder setLength(final java.lang.Short value) { if (value != null) { checkLengthRange(value); } this._length = value; return this; }
public NshEntryBuilder setNsp(final java.lang.Long value) { if (value != null) { checkNspRange(value); } this._nsp = value; return this; }
public NshEntryBuilder(NshEntry base) { if (base.getKey() == null) { this._key = new NshEntryKey( base.getName() ); this._name = base.getName(); } else { this._key = base.getKey(); this._name = _key.getName(); } this._length = base.getLength(); this._mdType = base.getMdType(); this._nextProtocol = base.getNextProtocol(); this._nsi = base.getNsi(); this._nsp = base.getNsp(); this._version = base.getVersion(); if (base instanceof NshEntryImpl) { NshEntryImpl impl = (NshEntryImpl) 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.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private NshEntryImpl(NshEntryBuilder base) { if (base.getKey() == null) { this._key = new NshEntryKey( base.getName() ); this._name = base.getName(); } else { this._key = base.getKey(); this._name = _key.getName(); } this._length = base.getLength(); this._mdType = base.getMdType(); this._nextProtocol = base.getNextProtocol(); this._nsi = base.getNsi(); this._nsp = base.getNsp(); this._version = base.getVersion(); 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.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
final String entryName = key.getName(); if (!nshEntryContext.containsIndex(entryName, ctx.getMappingContext())) { LOG.debug("Could not find nsh entry {} in the naming context", entryName); LOG.debug("Has no Nsh Entry {} in VPP. ", key.getName()); return; LOG.trace("Nsh Entry : {} attributes returned from VPP: {}", key.getName(), reply); builder.setName(entryName); builder.setKey(key); builder.setVersion( (short) nshEntryDetails.verOC ); builder.setLength( (short) nshEntryDetails.length ); builder.setNextProtocol(Ipv4.class); break; case 2: builder.setNextProtocol(Ipv6.class); break; case 3: builder.setNextProtocol(Ethernet.class); break; default: builder.setMdType(MdType1.class); setNshEntryMdType1Augment(builder, nshEntryDetails); break; builder.setMdType(MdType1.class);
if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_length, other.getLength())) { return false; if (!Objects.equals(_mdType, other.getMdType())) { return false; if (!Objects.equals(_name, other.getName())) { return false; if (!Objects.equals(_nextProtocol, other.getNextProtocol())) { return false; if (!Objects.equals(_nsi, other.getNsi())) { return false; if (!Objects.equals(_nsp, other.getNsp())) { return false; if (!Objects.equals(_version, other.getVersion())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
final String nshName = nshEntryContext.getName(detail.entryIndex, context.getMappingContext()); LOG.debug("vppstate.NshEntryCustomizer.getAllIds: nName={}", nshName); allIds.add(new NshEntryKey(nshName));
@Override protected VppNsh convert(final VppNshState operationalData) { // Just convert operational data into config data // The operational data are queried from lower layer using readerCustomizers from this plugin LOG.info("Initializing VppNsh config data from: {}", operationalData); VppNshBuilder vppNshBuilder = new VppNshBuilder(); NshEntriesBuilder nshEntriesBuilder = new NshEntriesBuilder() .setNshEntry(operationalData.getNshEntries().getNshEntry().stream() .map(oper -> new NshEntryBuilder(oper).setName(oper.getName()).build()) .collect(Collectors.toList())); vppNshBuilder.setNshEntries(nshEntriesBuilder.build()); NshMapsBuilder nshMapsBuilder = new NshMapsBuilder() .setNshMap(operationalData.getNshMaps().getNshMap().stream() .map(oper -> new NshMapBuilder(oper).setName(oper.getName()).build()) .collect(Collectors.toList())); vppNshBuilder.setNshMaps(nshMapsBuilder.build()); return vppNshBuilder.build(); } }
public NshEntryBuilder setVersion(final java.lang.Short value) { if (value != null) { checkVersionRange(value); } this._version = value; return this; }
public NshEntry build() { return new NshEntryImpl(this); }
@Nonnull @Override public NshEntryBuilder getBuilder(@Nonnull final InstanceIdentifier<NshEntry> id) { return new NshEntryBuilder(); }
public NshEntryBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.nsh.rev160624.vpp.nsh.state.nsh.entries.NshEntry> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
private void setNshEntryMdType1Augment(@Nonnull final NshEntryBuilder builder, @Nonnull NshEntryDetails nshEntryDetails) { final NshMdType1StateAugmentBuilder augmentBuilder = new NshMdType1StateAugmentBuilder(); augmentBuilder.setC1((long)nshEntryDetails.c1); augmentBuilder.setC2((long)nshEntryDetails.c2); augmentBuilder.setC3((long)nshEntryDetails.c3); augmentBuilder.setC4((long)nshEntryDetails.c4); builder.addAugmentation(NshMdType1StateAugment.class, augmentBuilder.build()); }