Class ParameterTypeString
- java.lang.Object
-
- org.opentrafficsim.base.Type<ParameterType<T>>
-
- org.opentrafficsim.base.parameters.ParameterType<java.lang.String>
-
- org.opentrafficsim.base.parameters.ParameterTypeString
-
- All Implemented Interfaces:
java.io.Serializable,Identifiable
public class ParameterTypeString extends ParameterType<java.lang.String>
Parameter type forStringparameters.Copyright (c) 2013-2020 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 11 sep. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.base.parameters.ParameterType
defaultValue
-
-
Constructor Summary
Constructors Constructor Description ParameterTypeString(java.lang.String id, java.lang.String description)ParameterTypeString(java.lang.String id, java.lang.String description, java.lang.String defaultValue)ParameterTypeString(java.lang.String id, java.lang.String description, java.lang.String defaultValue, Constraint<? super java.lang.String> constraint)ParameterTypeString(java.lang.String id, java.lang.String description, Constraint<? super java.lang.String> constraint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringprintValue(Parameters parameters)Print the given value from the map in Parameters in a presentable format.java.lang.StringtoString()-
Methods inherited from class org.opentrafficsim.base.parameters.ParameterType
check, checkConstraint, equals, getConstraint, getDefaultValue, getDescription, getId, getValueClass, hasDefaultValue, hashCode
-
-
-
-
Constructor Detail
-
ParameterTypeString
public ParameterTypeString(java.lang.String id, java.lang.String description)- Parameters:
id- String; short name of the new ParameterTypeStringdescription- String; description or full name of the new ParameterTypeString
-
ParameterTypeString
public ParameterTypeString(java.lang.String id, java.lang.String description, java.lang.String defaultValue)- Parameters:
id- String; short name of the new ParameterTypeStringdescription- String; description or full name of the new ParameterTypeStringdefaultValue- String; default value of the new ParameterTypeString
-
ParameterTypeString
public ParameterTypeString(java.lang.String id, java.lang.String description, Constraint<? super java.lang.String> constraint)- Parameters:
id- String; short name of the new ParameterTypeStringdescription- String; description or full name of the new ParameterTypeStringconstraint- Constraint<? super String>; constraint that applies to the value of the new ParameterTypeString
-
ParameterTypeString
public ParameterTypeString(java.lang.String id, java.lang.String description, java.lang.String defaultValue, Constraint<? super java.lang.String> constraint)- Parameters:
id- String; short name of the new ParameterTypeStringdescription- String; description or full name of the new ParameterTypeStringdefaultValue- String; default value of the new ParameterTypeStringconstraint- Constraint<? super String>; constraint that applies to the value of the new ParameterTypeString
-
-
Method Detail
-
printValue
public final java.lang.String printValue(Parameters parameters) throws ParameterException
Print the given value from the map in Parameters in a presentable format. The default implementation simply returns the output of toString().- Overrides:
printValuein classParameterType<java.lang.String>- Parameters:
parameters- Parameters; Parameters to get the value from- Returns:
- String; readable representation of the value
- Throws:
ParameterException- If the parameter is not present
-
toString
public java.lang.String toString()
- Overrides:
toStringin classParameterType<java.lang.String>
-
-