Skip to content

Commit c58248e

Browse files
0utplayjpenilla
authored andcommitted
Register the duration argument parser in the default parser registry (#333)
1 parent c2b3145 commit c58248e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cloud-core/src/main/java/cloud/commandframework/arguments/parser/StandardParserRegistry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import cloud.commandframework.arguments.standard.ByteArgument;
3232
import cloud.commandframework.arguments.standard.CharArgument;
3333
import cloud.commandframework.arguments.standard.DoubleArgument;
34+
import cloud.commandframework.arguments.standard.DurationArgument;
3435
import cloud.commandframework.arguments.standard.EnumArgument;
3536
import cloud.commandframework.arguments.standard.FloatArgument;
3637
import cloud.commandframework.arguments.standard.IntegerArgument;
@@ -43,6 +44,7 @@
4344
import io.leangen.geantyref.GenericTypeReflector;
4445
import io.leangen.geantyref.TypeToken;
4546
import java.lang.annotation.Annotation;
47+
import java.time.Duration;
4648
import java.util.Arrays;
4749
import java.util.Collection;
4850
import java.util.HashMap;
@@ -163,6 +165,7 @@ public StandardParserRegistry() {
163165
return new BooleanArgument.BooleanParser<>(liberal);
164166
});
165167
this.registerParserSupplier(TypeToken.get(UUID.class), options -> new UUIDArgument.UUIDParser<>());
168+
this.registerParserSupplier(TypeToken.get(Duration.class), options -> new DurationArgument.DurationParser<>());
166169
}
167170

168171
private static boolean isPrimitive(final @NonNull TypeToken<?> type) {

0 commit comments

Comments
 (0)