View Javadoc
1   package org.opentrafficsim.road.network.factory.osm.events;
2   
3   import java.util.EventObject;
4   
5   /**
6    * <p>
7    * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
8    * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
9    * <p>
10   * $LastChangedDate: 2015-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $,
11   * initial version 20.03.2015 <br>
12   * @author <a>Moritz Bergmann</a>
13   */
14  public class WarningEvent extends EventObject
15  {
16      /** */
17      private static final long serialVersionUID = 1L;
18  
19      /** Object which caused the warning. */
20  
21      /** Textual description of the warning. */
22      private String warning;
23  
24      /**
25       * @param source Object; of the WarningEvent.
26       * @param warn String; Textual description of the warning.
27       */
28      public WarningEvent(final Object source, final String warn)
29      {
30          super(source);
31          this.warning = warn;
32      }
33  
34      /**
35       * @return Get the textual description of the warning.
36       */
37      public final String getWarning()
38      {
39          return this.warning;
40      }
41  
42      /** {@inheritDoc} */
43      @Override
44      public final String toString()
45      {
46          return "WarningEvent [warning=" + this.warning + "]";
47      }
48  }