ParameterTypeDuration.java

  1. package org.opentrafficsim.base.parameters;

  2. import java.io.Serializable;

  3. import org.djunits.value.vdouble.scalar.Duration;
  4. import org.opentrafficsim.base.parameters.constraint.Constraint;

  5. /**
  6.  * Wrapper class for Time parameters.
  7.  * <p>
  8.  * Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  9.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
  10.  * <p>
  11.  * @version $Revision$, $LastChangedDate$, by $Author$, initial version Apr 13, 2016 <br>
  12.  * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
  13.  * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
  14.  */
  15. public class ParameterTypeDuration extends ParameterTypeNumeric<Duration> implements Serializable
  16. {

  17.     /** */
  18.     private static final long serialVersionUID = 20150400L;

  19.     /**
  20.      * Construct a new ParameterTypeDuration without default value and check.
  21.      * @param id String; short name of the new ParameterTypeDuration
  22.      * @param description String; parameter description or full name of the new ParameterTypeDuration
  23.      */
  24.     public ParameterTypeDuration(final String id, final String description)
  25.     {
  26.         super(id, description, Duration.class);
  27.     }

  28.     /**
  29.      * Construct a new ParameterTypeDuration with default value, without check.
  30.      * @param id String; short name of the new ParameterTypeDuration
  31.      * @param description String; parameter description or full name of the new ParameterTypeDuration
  32.      * @param defaultValue Duration; the default value for the new ParameterTypeDuration
  33.      */
  34.     public ParameterTypeDuration(final String id, final String description, final Duration defaultValue)
  35.     {
  36.         super(id, description, Duration.class, defaultValue);
  37.     }

  38.     /**
  39.      * Construct a new ParameterTypeDuration without default value, with check.
  40.      * @param id String; short name of the new ParameterTypeDuration
  41.      * @param description String; parameter description or full name of the new ParameterTypeDuration
  42.      * @param constraint Constraint&lt;? super Duration&gt;; Constraint for parameter values
  43.      */
  44.     public ParameterTypeDuration(final String id, final String description, final Constraint<? super Duration> constraint)
  45.     {
  46.         super(id, description, Duration.class, constraint);
  47.     }

  48.     /**
  49.      * Construct a new ParameterTypeDuration with default value and check.
  50.      * @param id String; short name of the new ParameterTypeDuration
  51.      * @param description String; parameter description or full name of the new ParameterTypeDuration
  52.      * @param defaultValue Duration; Default value of the new ParameterTypeDuration
  53.      * @param constraint Constraint&lt;? super Duration&gt;; Constraint for parameter values
  54.      */
  55.     public ParameterTypeDuration(final String id, final String description, final Duration defaultValue,
  56.             final Constraint<? super Duration> constraint)
  57.     {
  58.         super(id, description, Duration.class, defaultValue, constraint);
  59.     }

  60.     /** {@inheritDoc} */
  61.     @Override
  62.     public final String toString()
  63.     {
  64.         return "ParameterTypeDuration [id=" + getId() + ", description=" + getDescription() + "]";
  65.     }

  66. }