Class ClassConstraint<T>

java.lang.Object
org.opentrafficsim.base.parameters.constraint.CollectionConstraint<java.lang.Class<? extends T>>
org.opentrafficsim.base.parameters.constraint.ClassConstraint<T>
Type Parameters:
T - super type for all possible classes, e.g. TacticalPlanner
All Implemented Interfaces:
Constraint<java.lang.Class<? extends T>>

public final class ClassConstraint<T>
extends CollectionConstraint<java.lang.Class<? extends T>>
Constraint that checks whether the value is any of a given collection of classes, where each class is a sub class of a given type.

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 30 jun. 2017
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Field Summary

    Fields inherited from class org.opentrafficsim.base.parameters.constraint.CollectionConstraint

    objects
  • Method Summary

    Modifier and Type Method Description
    static <T> ClassConstraint<T> newInstance​(java.lang.Class<? extends T>... objs)
    Creates a new instance with given collection.
    java.lang.String toString()

    Methods inherited from class org.opentrafficsim.base.parameters.constraint.CollectionConstraint

    accept, failMessage, newInstance

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • newInstance

      @SafeVarargs public static <T> ClassConstraint<T> newInstance​(java.lang.Class<? extends T>... objs)
      Creates a new instance with given collection.
      Type Parameters:
      T - type class
      Parameters:
      objs - Class<? extends T>...; acceptable classes
      Returns:
      new instance with given collection
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class CollectionConstraint<java.lang.Class<? extends T>>