# Class MaterialAddedEvent

java.lang.Object
com.university.bookstore.observer.MaterialAddedEvent

All Implemented Interfaces:
  `MaterialEvent`

public class MaterialAddedEvent extends Object implements MaterialEvent
Event that occurs when a material is added to the system.

Since:
  2024-09-15
Version:
  3.0
Author:
  Navid Mohaghegh

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MaterialAddedEvent(Material material)`
  Creates a new material added event.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `String`
  `getDescription()`
  Gets a description of this event.
  `String`
  `getEventType()`
  Gets the type of this event.
  `Material`
  `getMaterial()`
  Gets the material associated with this event.
  `long`
  `getTimestamp()`
  Gets the timestamp when this event occurred.
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### MaterialAddedEvent

    public MaterialAddedEvent(Material material)
    Creates a new material added event.
    Parameters:
      `material` - the material that was added
    Throws:
      `IllegalArgumentException` - if material is null

- ## Method Details

  - ### getMaterial

    public Material getMaterial()
    Description copied from interface: `MaterialEvent`
    Gets the material associated with this event.
    Specified by:
      `getMaterial` in interface `MaterialEvent`
    Returns:
      the material

  - ### getTimestamp

    public long getTimestamp()
    Description copied from interface: `MaterialEvent`
    Gets the timestamp when this event occurred.
    Specified by:
      `getTimestamp` in interface `MaterialEvent`
    Returns:
      the event timestamp in milliseconds

  - ### getEventType

    public String getEventType()
    Description copied from interface: `MaterialEvent`
    Gets the type of this event.
    Specified by:
      `getEventType` in interface `MaterialEvent`
    Returns:
      the event type

  - ### getDescription

    public String getDescription()
    Description copied from interface: `MaterialEvent`
    Gets a description of this event.
    Specified by:
      `getDescription` in interface `MaterialEvent`
    Returns:
      the event description

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`