Class EventType

  • All Implemented Interfaces:
    Serializable, EventTypeInterface

    public class EventType
    extends AbstractEventType
    The EventType is the description of a topic used for the subscription to asynchronous events. Event types are used by EventProducers to show which events they potentially fire. EventTypes are typically defined as static final fields. This class only accepts when the producer fires events of type Event, and not a subclass of Event.

    Copyright (c) 2020-2021 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.
    Author:
    Alexander Verbraeck, Peter Knoppers
    See Also:
    Serialized Form
    • Constructor Detail

      • EventType

        public EventType​(String name,
                         MetaData metaData)
        Construct a new EventType. Only events of the type Event, and no subclasses of Event, can be used to fire events of this type. This means that firing a TimedEvent of this type will result in an error.
        Parameters:
        name - String; the name of the new eventType. Two values are not appreciated: null and the empty string.
        metaData - MetaData; describes the payload of events of the new EventType;
      • EventType

        public EventType​(MetaData metaData)
        Construct a new EventType. The name of the metadata will function as the name of the event. Only events of the type Event, and no subclasses of Event, can be used to fire events of this type. This means that firing a TimedEvent of this type will result in an error.
        Parameters:
        metaData - MetaData; describes the payload of events of the new EventType;
      • EventType

        @Deprecated
        public EventType​(String name)
        Deprecated.
        Construct a new EventType with no meta data. Only events of the type Event, and no subclasses of Event, can be used to fire events of this type. This means that firing a TimedEvent of this type will result in an error.
        Parameters:
        name - String; the name of the new eventType. Two values are not appreciated: null and the empty string.