Class EnumArgument<T extends java.lang.Enum<T>>

  • All Implemented Interfaces:
    com.mojang.brigadier.arguments.ArgumentType<T>

    public class EnumArgument<T extends java.lang.Enum<T>>
    extends java.lang.Object
    implements com.mojang.brigadier.arguments.ArgumentType<T>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<T> enumClass  
      private static com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType INVALID_ENUM  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private EnumArgument​(java.lang.Class<T> enumClass)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <R extends java.lang.Enum<R>>
      EnumArgument<R>
      enumArgument​(java.lang.Class<R> enumClass)  
      java.util.Collection<java.lang.String> getExamples()  
      <S> java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions​(com.mojang.brigadier.context.CommandContext<S> context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)  
      T parse​(com.mojang.brigadier.StringReader reader)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INVALID_ENUM

        private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType INVALID_ENUM
      • enumClass

        private final java.lang.Class<T extends java.lang.Enum<T>> enumClass
    • Constructor Detail

      • EnumArgument

        private EnumArgument​(java.lang.Class<T> enumClass)
    • Method Detail

      • enumArgument

        public static <R extends java.lang.Enum<R>> EnumArgument<R> enumArgument​(java.lang.Class<R> enumClass)
      • parse

        public T parse​(com.mojang.brigadier.StringReader reader)
                throws com.mojang.brigadier.exceptions.CommandSyntaxException
        Specified by:
        parse in interface com.mojang.brigadier.arguments.ArgumentType<T extends java.lang.Enum<T>>
        Throws:
        com.mojang.brigadier.exceptions.CommandSyntaxException
      • listSuggestions

        public <S> java.util.concurrent.CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions​(com.mojang.brigadier.context.CommandContext<S> context,
                                                                                                                       com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
        Specified by:
        listSuggestions in interface com.mojang.brigadier.arguments.ArgumentType<T extends java.lang.Enum<T>>
      • getExamples

        public java.util.Collection<java.lang.String> getExamples()
        Specified by:
        getExamples in interface com.mojang.brigadier.arguments.ArgumentType<T extends java.lang.Enum<T>>