/** * Sets an optional parameter by checking if the tag already exists in our * list of optional parameters. If it already exists, will replace the old * value with the new value. * @param tlv The TLV to add/set * @return Null if no TLV was replaced, or the TLV replaced. */ public Tlv setOptionalParameter(Tlv tlv) { // does this parameter already exist? int i = this.findOptionalParameter(tlv.getTag()); if (i < 0) { // parameter does not yet exist, add it, not replaced this.addOptionalParameter(tlv); return null; } else { // this parameter already exists, replace it, return old return this.optionalParameters.set(i, tlv); } }
/** * Sets an optional parameter by checking if the tag already exists in our * list of optional parameters. If it already exists, will replace the old * value with the new value. * @param tlv The TLV to add/set * @return Null if no TLV was replaced, or the TLV replaced. */ public Tlv setOptionalParameter(Tlv tlv) { // does this parameter already exist? int i = this.findOptionalParameter(tlv.getTag()); if (i < 0) { // parameter does not yet exist, add it, not replaced this.addOptionalParameter(tlv); return null; } else { // this parameter already exists, replace it, return old return this.optionalParameters.set(i, tlv); } }
/** * Sets an optional parameter by checking if the tag already exists in our * list of optional parameters. If it already exists, will replace the old * value with the new value. * @param tlv The TLV to add/set * @return Null if no TLV was replaced, or the TLV replaced. */ public Tlv setOptionalParameter(Tlv tlv) { // does this parameter already exist? int i = this.findOptionalParameter(tlv.getTag()); if (i < 0) { // parameter does not yet exist, add it, not replaced this.addOptionalParameter(tlv); return null; } else { // this parameter already exists, replace it, return old return this.optionalParameters.set(i, tlv); } }
/** * Sets an optional parameter by checking if the tag already exists in our * list of optional parameters. If it already exists, will replace the old * value with the new value. * @param tlv The TLV to add/set * @return Null if no TLV was replaced, or the TLV replaced. */ public Tlv setOptionalParameter(Tlv tlv) { // does this parameter already exist? int i = this.findOptionalParameter(tlv.getTag()); if (i < 0) { // parameter does not yet exist, add it, not replaced this.addOptionalParameter(tlv); return null; } else { // this parameter already exists, replace it, return old return this.optionalParameters.set(i, tlv); } }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }
public void readOptionalParameters(ChannelBuffer buffer, PduTranscoderContext context) throws UnrecoverablePduException, RecoverablePduException { // if there is any data left, it's part of an optional parameter while (buffer.readableBytes() > 0) { Tlv tlv = ChannelBufferUtil.readTlv(buffer); if (tlv.getTagName() == null) { tlv.setTagName(context.lookupTlvTagName(tlv.getTag())); } this.addOptionalParameter(tlv); } }