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

    Fields
    Modifier and Type
    Field
    Description
    static final long
    The time returned when the text is not a duration.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Reads a duration.

    Methods inherited from interface org.incendo.cloud.parser.ArgumentParser

    flatMap, flatMapSuccess, mapSuccess, parse, parseFuture, suggestionProvider

    Methods inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider

    suggestionsFuture

    Methods inherited from interface org.incendo.cloud.suggestion.BlockingSuggestionProvider.Strings

    stringSuggestions, suggestions
  • Field Details

    • UNKNOWN_TIME

      static final long UNKNOWN_TIME
      The time returned when the text is not a duration.
      See Also:
  • Method Details

    • parseTime

      long parseTime(String value)
      Reads a duration.
      Parameters:
      value - the text
      Returns:
      the duration in milliseconds