WarningEvent.java

  1. package org.opentrafficsim.road.network.factory.osm.events;

  2. import java.util.EventObject;

  3. /**
  4.  * <p>
  5.  * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  6.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  7.  * <p>
  8.  * $LastChangedDate: 2015-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $,
  9.  * initial version 20.03.2015 <br>
  10.  * @author <a>Moritz Bergmann</a>
  11.  */
  12. public class WarningEvent extends EventObject
  13. {
  14.     /** */
  15.     private static final long serialVersionUID = 1L;

  16.     /** Object which caused the warning. */

  17.     /** Textual description of the warning. */
  18.     private String warning;

  19.     /**
  20.      * @param source of the WarningEvent.
  21.      * @param warn Textual description of the warning.
  22.      */
  23.     public WarningEvent(final Object source, final String warn)
  24.     {
  25.         super(source);
  26.         this.warning = warn;
  27.     }

  28.     /**
  29.      * @return Get the textual description of the warning.
  30.      */
  31.     public final String getWarning()
  32.     {
  33.         return this.warning;
  34.     }

  35.     /** {@inheritDoc} */
  36.     @Override
  37.     public final String toString()
  38.     {
  39.         return "WarningEvent [warning=" + this.warning + "]";
  40.     }
  41. }