Move the lowercase unmarshalling entity code.

This commit is contained in:
Matthew Miller 2018-08-04 10:09:28 +10:00
parent f19d2ee73d
commit a6cfe7d0c9

View File

@ -40,7 +40,7 @@ protected EntityTypeFlag(String name) {
@Override
public EntityType parseInput(FlagContext context) throws InvalidFlagFormat {
String input = context.getUserInput();
input = input.trim().toLowerCase();
input = input.trim();
EntityType entityType = unmarshal(input);
if (entityType == null) {
throw new InvalidFlagFormat("Unknown entity type: " + input);
@ -50,7 +50,7 @@ public EntityType parseInput(FlagContext context) throws InvalidFlagFormat {
@Override
public EntityType unmarshal(@Nullable Object o) {
return EntityTypes.get(String.valueOf(o));
return EntityTypes.get(String.valueOf(o).toLowerCase());
}
@Override