public NoPathBuilder setNatureOfIssue(final java.lang.Short value) { if (value != null) { checkNatureOfIssueRange(value); } this._natureOfIssue = value; return this; }
public NoPath build() { return new NoPathImpl(this); }
public NoPathBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public NoPathBuilder(NoPath base) { this._natureOfIssue = base.getNatureOfIssue(); this._tlvs = base.getTlvs(); this._ignore = base.isIgnore(); this._processingRule = base.isProcessingRule(); this._unsatisfiedConstraints = base.isUnsatisfiedConstraints(); if (base instanceof NoPathImpl) { NoPathImpl impl = (NoPathImpl) 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.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
@Override public NoPath parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException { Preconditions.checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty."); final NoPathBuilder builder = new NoPathBuilder(); builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); builder.setNatureOfIssue(bytes.readUnsignedByte()); final BitArray flags = BitArray.valueOf(bytes, FLAGS_SIZE); builder.setUnsatisfiedConstraints(flags.get(C_FLAG_OFFSET)); bytes.skipBytes(RESERVED_F_LENGTH); final TlvsBuilder tlvsBuilder = new TlvsBuilder(); parseTlvs(tlvsBuilder, bytes.slice()); builder.setTlvs(tlvsBuilder.build()); return builder.build(); }
@Override public void serializeObject(final Object object, final ByteBuf buffer) { Preconditions.checkArgument(object instanceof NoPath, "Wrong instance of PCEPObject. Passed %s. Needed NoPathObject.", object.getClass()); final NoPath nPObj = (NoPath) object; final ByteBuf body = Unpooled.buffer(); Preconditions.checkArgument(nPObj.getNatureOfIssue() != null, "NatureOfIssue is mandatory."); writeUnsignedByte(nPObj.getNatureOfIssue(), body); final BitArray flags = new BitArray(FLAGS_SIZE); flags.set(C_FLAG_OFFSET, nPObj.isUnsatisfiedConstraints()); flags.toByteBuf(body); body.writeZero(RESERVED_F_LENGTH); serializeTlvs(nPObj.getTlvs(), body); ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer); }
private NoPathImpl(NoPathBuilder base) { this._natureOfIssue = base.getNatureOfIssue(); this._tlvs = base.getTlvs(); this._ignore = base.isIgnore(); this._processingRule = base.isProcessingRule(); this._unsatisfiedConstraints = base.isUnsatisfiedConstraints(); 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.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath>> 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.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcrep.message.pcrep.message.replies.result.failure._case.NoPath>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
if (!Objects.equals(_natureOfIssue, other.getNatureOfIssue())) { return false; if (!Objects.equals(_tlvs, other.getTlvs())) { return false; if (!Objects.equals(_ignore, other.isIgnore())) { return false; if (!Objects.equals(_processingRule, other.isProcessingRule())) { return false; if (!Objects.equals(_unsatisfiedConstraints, other.isUnsatisfiedConstraints())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;