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 for
String parameters.
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
-
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
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 Details
-
ParameterTypeString
- Parameters:
id- String; short name of the new ParameterTypeStringdescription- String; description or full name of the new ParameterTypeString
-
ParameterTypeString
- 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
- 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 Details
-
printValue
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
- Overrides:
toStringin classParameterType<String>
-