@Test public void testAddIfNoneMatchHeader() { CoAPOptionHeader h = new CoAPOptionHeader(CoAPOptionName.IF_NONE_MATCH); assertTrue(resp.addOptionHeader(h)); assertFalse(resp.addOptionHeader(h)); assertNull(h.getValue()); assertEquals(0, h.getLength()); }
public synchronized boolean addOptionHeader(CoAPOptionHeader option) { boolean ok = okToAddHeader(option); if (ok) { get(option).add(option); } return ok; }
CoAPMessage { public synchronized boolean addOptionHeader(CoAPOptionHeader option) { boolean ok = okToAddHeader(option); if (ok) { get(option).add(option); } return ok; } }
CoAPMessage { public synchronized boolean addOptionHeader(CoAPOptionHeader option) { boolean ok = okToAddHeader(option); if (ok) { get(option).add(option); } return ok; } CoAPMessage(int version, CoAPMessageType messageType,
            CoAPCode methodCode, int messageId, byte[] token);  CoAPMessage(CoAPMessageType messageType, CoAPCode methodCode,
            int messageId, byte[] token); }
CoAPMessage { public synchronized boolean addOptionHeader(CoAPOptionHeader option) { boolean ok = okToAddHeader(option); if (ok) { get(option).add(option); } return ok; } CoAPMessage(int version, CoAPMessageType messageType,
            CoAPCode methodCode, int messageId, byte[] token);  CoAPMessage(CoAPMessageType messageType, CoAPCode methodCode,
            int messageId, byte[] token); void setVersion(short version); int getVersion(); void setMessageType(CoAPMessageType messageType); CoAPMessageType getMessageType(); int getOptionCount(); void setCode(CoAPCode code); CoAPCode getCode(); void setToken(byte[] token); byte[] getToken(); void setMessageId(int messageId); int getMessageId(); synchronized boolean addOptionHeader(CoAPOptionHeader option); boolean removeOptionHeader(CoAPOptionHeader option); void setPayload(byte[] payload); byte[] getPayload(); List<CoAPOptionHeader> getOptionHeaders(); List<CoAPOptionHeader> getOptionHeaders(CoAPOptionName optionName); void setOptionHeaders(List<CoAPOptionHeader> headers); int getRetransmissions(); int getTimeout(); void messageRetransmitted(); boolean messageCanceled(); void setMessageCanceled(boolean canceled); void setSocketAddress(InetSocketAddress remoteSocketAddress); InetSocketAddress getSocketAddress(); String getIdentifier(); CoAPOptionHeader getUriHostOptionHeader(); byte[] encoded(); boolean isObserveMessage(); long getMaxAge(); String logMessage(); }
CoAPMessage { public synchronized boolean addOptionHeader(CoAPOptionHeader option) { boolean ok = okToAddHeader(option); if (ok) { get(option).add(option); } return ok; } CoAPMessage(int version, CoAPMessageType messageType,
            CoAPCode methodCode, int messageId, byte[] token);  CoAPMessage(CoAPMessageType messageType, CoAPCode methodCode,
            int messageId, byte[] token); void setVersion(short version); int getVersion(); void setMessageType(CoAPMessageType messageType); CoAPMessageType getMessageType(); int getOptionCount(); void setCode(CoAPCode code); CoAPCode getCode(); void setToken(byte[] token); byte[] getToken(); void setMessageId(int messageId); int getMessageId(); synchronized boolean addOptionHeader(CoAPOptionHeader option); boolean removeOptionHeader(CoAPOptionHeader option); void setPayload(byte[] payload); byte[] getPayload(); List<CoAPOptionHeader> getOptionHeaders(); List<CoAPOptionHeader> getOptionHeaders(CoAPOptionName optionName); void setOptionHeaders(List<CoAPOptionHeader> headers); int getRetransmissions(); int getTimeout(); void messageRetransmitted(); boolean messageCanceled(); void setMessageCanceled(boolean canceled); void setSocketAddress(InetSocketAddress remoteSocketAddress); InetSocketAddress getSocketAddress(); String getIdentifier(); CoAPOptionHeader getUriHostOptionHeader(); byte[] encoded(); boolean isObserveMessage(); long getMaxAge(); String logMessage(); static final String MESSAGE_ID; static final String TOKEN; static final String URI; }