Class VerifyRequiredMethods

java.lang.Object
org.opentrafficsim.road.VerifyRequiredMethods

public class VerifyRequiredMethods
extends java.lang.Object
Verify that all classes have a toString method (unless the class in non-instantiable, or an enum, or abstract.
Verify that no class overrides equals without overriding hashCode.
Verify that classes that can be instantiated are Serializable for those classes that this makes sense.

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version Apr 13, 2016
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Summary

    Constructors 
    Constructor Description
    VerifyRequiredMethods()  
  • Method Summary

    Modifier and Type Method Description
    void equalsAndHashCodeTest()
    Check that all classes that implement equals also implement hashCode.
    void serializableTest()
    Check that all classes implement the Serializable interface.
    void toStringTest()
    Check that all classes have a toString method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • toStringTest

      public final void toStringTest()
      Check that all classes have a toString method.
    • serializableTest

      public final void serializableTest()
      Check that all classes implement the Serializable interface.
    • equalsAndHashCodeTest

      public final void equalsAndHashCodeTest()
      Check that all classes that implement equals also implement hashCode.