code: private static Result<?> decodePayload(
              ByteBuf buffer,
              MqttMessageType messageType,
              int bytesRemainingInVariablePart,
              Object variableHeader) {
          switch (messageType) {
              case CONNECT:
                  return decodeConnectionPayload(buffer, (MqttConnectVariableHeader) variableHeader);
  
              case SUBSCRIBE:
                  return decodeSubscribePayload(buffer, bytesRemainingInVariablePart);
  
              case SUBACK:
                  return decodeSubackPayload(buffer, bytesRemainingInVariablePart);
  
              case UNSUBSCRIBE:
                  return decodeUnsubscribePayload(buffer, bytesRemainingInVariablePart);
  
              case PUBLISH:
                  return decodePublishPayload(buffer, bytesRemainingInVariablePart);
  
              default:
                  // unknown payload , no byte consumed
                  return new Result<Object>(null, 0);
          }
      }
docs: Decodes the payload.
  
  @param buffer the buffer to decode from
  @param messageType  type of the message being decoded
  @param bytesRemainingInVariablePart bytes remaining
  @param variableHeader variable header of the same message
  @return the payload