findPrevious method

  1. @override
CoapExchange? findPrevious(
  1. int? key,
  2. CoapExchange exchange
)
override

Checks if the specified key is already associated with a previous exchange and otherwise associates the key with the exchange specified.

Implementation

@override
CoapExchange? findPrevious(final int? key, final CoapExchange exchange) {
  CoapExchange? prev;
  if (_incomingMessages.containsKey(key)) {
    prev = _incomingMessages[key];
  }
  _incomingMessages[key] = exchange;
  return prev;
}