Implement the Chat Handler Class

Introduction

From this lesson onwards, we are going to start implementing the project. We'll be following the steps mentioned below:

  1. Create a class to construct our chat list data structure.

  2. Implement a function to get the current time and attach it to every new message.

  3. Write a function to create a node to store the user's name, image, and message.

  4. Write a function to get a node from the linked list using the hashmap and the user's id.

  5. Write a utility function to handle the scenario where a new message is generated.

  6. Write a utility function to handle the scenario where a message is deleted.

Before starting the implementation, let's first make sure we understand how the chat list will be stored internally.

Get hands-on with 1200+ tech skills courses.