Interface DurationReasonParser
- All Superinterfaces:
org.incendo.cloud.parser.ArgumentParser<FPlayer, Pair<Long,String>>, org.incendo.cloud.suggestion.BlockingSuggestionProvider<FPlayer>, org.incendo.cloud.suggestion.BlockingSuggestionProvider.Strings<FPlayer>, org.incendo.cloud.suggestion.SuggestionProvider<FPlayer>, org.incendo.cloud.suggestion.SuggestionProviderHolder<FPlayer>
public interface DurationReasonParser
extends org.incendo.cloud.parser.ArgumentParser<FPlayer, Pair<Long,String>>, org.incendo.cloud.suggestion.BlockingSuggestionProvider.Strings<FPlayer>
Command argument that reads a duration followed by a free-text reason, so `/ban x 7d spam`
splits into the time and the rest.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.parser.ArgumentParser
org.incendo.cloud.parser.ArgumentParser.FutureArgumentParser<C,T> Nested classes/interfaces inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider
org.incendo.cloud.suggestion.BlockingSuggestionProvider.Strings<C> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe time returned when the text is not a duration. -
Method Summary
Methods inherited from interface org.incendo.cloud.parser.ArgumentParser
flatMap, flatMapSuccess, mapSuccess, parse, parseFuture, suggestionProviderMethods inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider
suggestionsFutureMethods inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider.Strings
stringSuggestions, suggestions
-
Field Details
-
UNKNOWN_TIME
static final long UNKNOWN_TIMEThe time returned when the text is not a duration.- See Also:
-
-
Method Details
-
parseTime
Reads a duration.- Parameters:
value- the text- Returns:
- the duration in milliseconds
-