Class Event

java.lang.Object
org.djutils.event.Event
Direct Known Subclasses:
TimedEvent

public class Event extends Object
The Event class forms the reference implementation for the Event.

Copyright (c) 2002-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html. This class was originally part of the DSOL project, see https://simulation.tudelft.nl/dsol/manual.

Author:
Peter Jacobs , Alexander Verbraeck
  • Constructor Details

    • Event

      public Event(EventType type, Object content)
      Construct a new Event, where compliance with the metadata is verified.
      Parameters:
      type - the name of the Event.
      content - the content of the event
    • Event

      public Event(EventType type, Object content, boolean verifyMetaData)
      Construct a new Event, with a choice to verify compliance with metadata.
      Parameters:
      type - the name of the Event.
      content - the content of the event
      verifyMetaData - whether to verify the compliance with metadata or not
  • Method Details

    • getContent

      public final Object getContent()
      Return the content (payload) of this event.
      Returns:
      the content (payload) of this event
    • getType

      public EventType getType()
      Return the type of the event.
      Returns:
      the type of the event
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object