Skip to content

Commit

Permalink
Simplify StringToEnumConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed May 9, 2023
1 parent 7538811 commit c4ee492
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ public boolean canConvert(Class<?> targetType) {
}

@Override
public Object convert(String source, Class<?> targetType) throws Exception {
return valueOf(targetType, source);
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private static Object valueOf(Class targetType, String source) {
public Object convert(String source, Class targetType) throws Exception {
return Enum.valueOf(targetType, source);
}

Expand Down

0 comments on commit c4ee492

Please sign in to comment.