Skip to content

Commit

Permalink
Bug-fix: fixed numerics not registered to the types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqzn committed Nov 2, 2024
1 parent 5b60ee7 commit c97ed94
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ private ParamTypeRegistry() {
registerResolver(String.class, ParameterTypes.string());
registerResolver(UUID.class, ParameterTypes.uuid());
registerResolver(CommandFlag.class, ParameterTypes.flag());

}

public static <S extends Source> ParamTypeRegistry<S> createDefault() {
Expand All @@ -44,7 +45,7 @@ public <T> void registerResolver(Type type, ParameterType<S, T> resolver) {

@SuppressWarnings("unchecked")
public Optional<ParameterType<S, ?>> getResolver(Type type) {
if (TypeWrap.of(type).isSubtypeOf(Number.class))
if (TypeUtility.isNumericType(TypeWrap.of(type)))
return Optional.of(ParameterTypes.numeric((Class<? extends Number>) type));

//TODO make check for enum
Expand Down

0 comments on commit c97ed94

Please sign in to comment.