Menu

Case sensitive values

Chris DeGreef

The --casesensitive parameter refers to the value the user enters when running your program. In this example it is IBM. The value the user enters is retained exactly as they enter it. --casesensitive only applies to the comparisons done against constraints.

If a --list has all lower-case values in it then everything the user types must be in lower-case or they will get an exception at runtime.

Because we use the --casesensitive parameter exceptions will be thrown. The values the user enters are not in the list. Case matters.

CmdLine.create("--type string --key ticker --casesensitive --list IBM goog");
> MyProgram --ticker Ibm
> MyProgram --ticker Goog

This example works because case does not matter.

CmdLine.create("--type string --key ticker --list IBM goog");
> MyProgram --ticker Ibm
> MyProgram --ticker Goog

Related

Wiki: Compiling

MongoDB Logo MongoDB