public abstract class ParametersImpl extends SipHeaderImpl implements Parameters
SipHeader.Builder<H extends SipHeader>
CANNOT_CAST_HEADER_OF_TYPE, UNABLE_TO_PARSE_OUT_THE_HEADER_NAME_DUE_TO_UNDERLYING_IO_EXCEPTION
Modifier | Constructor and Description |
---|---|
protected |
ParametersImpl(Buffer name,
Buffer value,
Buffer params) |
Modifier and Type | Method and Description |
---|---|
Buffer |
getParameter(Buffer name)
Get the value of the named parameter.
|
Buffer |
getParameter(String name)
Same as
Parameters.getParameter(Buffer) . |
protected Buffer |
getRawParams() |
void |
setParameter(Buffer name,
Buffer value)
Sets the value of the specified parameter.
|
void |
setParameter(Buffer name,
java.util.function.Supplier<Buffer> value) |
clone, copy, ensure, getBytes, getName, getValue, toString, transferValue, verify
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clone, copy, create, ensure, frame, frame, getBufferSize, getBytes, getName, getNameStr, getValue, is, is, isAddressParametersHeader, isCallIdHeader, isContactHeader, isContentLengthHeader, isContentTypeHeader, isCSeqHeader, isExpiresHeader, isFromHeader, isMaxForwardsHeader, isRecordRouteHeader, isRouteHeader, isSubjectHeader, isSystemHeader, isToHeader, isViaHeader, toAddressParametersHeader, toCallIdHeader, toContactHeader, toContentLengthHeader, toContentTypeHeader, toCSeqHeader, toExpiresHeader, toFromHeader, toMaxForwardsHeader, toRecordRouteHeader, toRouteHeader, toToHeader, toViaHeader, verify
public Buffer getParameter(Buffer name) throws SipParseException
Parameters
Buffer
, which can be checked with Buffer.isEmpty()
or
Buffer.capacity()
, which will return zero. As with any empty
Buffer
, if you do Buffer.toString()
you will be getting
an empty String
back, which would be yet another way to check for
a flag parameter.getParameter
in interface Parameters
name
- the name of the parameter we are looking for.SipParseException
- in case anything goes wrong while extracting the parameter.public Buffer getParameter(String name) throws SipParseException
Parameters
Parameters.getParameter(Buffer)
.getParameter
in interface Parameters
SipParseException
- in case anything goes wrong while extracting the parameter.public void setParameter(Buffer name, Buffer value) throws SipParseException, IllegalArgumentException
Parameters
setParameter
in interface Parameters
name
- the name of the parametervalue
- the value of the parameter or null if you just want to set a
flag parameterSipParseException
- in case anything goes wrong when setting the parameter.IllegalArgumentException
- in case the name is null or empty.public void setParameter(Buffer name, java.util.function.Supplier<Buffer> value) throws SipParseException, IllegalArgumentException
setParameter
in interface Parameters
SipParseException
IllegalArgumentException
protected Buffer getRawParams()
Copyright © 2021. All Rights Reserved.