Class ParameterTypeString
- java.lang.Object
-
- org.opentrafficsim.base.Type<ParameterType<T>>
-
- org.opentrafficsim.base.parameters.ParameterType<String>
-
- org.opentrafficsim.base.parameters.ParameterTypeString
-
- All Implemented Interfaces:
Serializable,Identifiable
public class ParameterTypeString extends ParameterType<String>
Parameter type forStringparameters.Copyright (c) 2013-2022 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(String id, String description)ParameterTypeString(String id, String description, String defaultValue)ParameterTypeString(String id, String description, String defaultValue, Constraint<? super String> constraint)ParameterTypeString(String id, String description, Constraint<? super String> constraint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringprintValue(Parameters parameters)Print the given value from the map in Parameters in a presentable format.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(String id, String description)
- Parameters:
id- String; short name of the new ParameterTypeStringdescription- String; description or full name of the new ParameterTypeString
-
ParameterTypeString
public ParameterTypeString(String id, String description, 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(String id, String description, Constraint<? super 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(String id, String description, String defaultValue, Constraint<? super 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 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<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 String toString()
- Overrides:
toStringin classParameterType<String>
-
-