Class CommandComponent<C>

  • Type Parameters:
    C - Command sender type

    public final class CommandComponent<C>
    extends java.lang.Object
    A single literal or argument component of a command
    Since:
    1.3.0
    • Method Detail

      • getArgument

        public @NonNull CommandArgument<C,​?> getArgument()
        Gets the command component argument details
        Returns:
        command component argument details
      • getDescription

        @Deprecated
        public @NonNull Description getDescription()
        Deprecated.
        for removal since 1.4.0. Use getArgumentDescription() instead.
        Gets the command component description
        Returns:
        command component description
      • getArgumentDescription

        public @NonNull ArgumentDescription getArgumentDescription()
        Gets the command component description
        Returns:
        command component description
        Since:
        1.4.0
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public @NonNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • of

        @Deprecated
        public static <C> @NonNull CommandComponent<C> of​(@NonNull CommandArgument<C,​?> commandArgument,
                                                          @NonNull Description commandDescription)
        Deprecated.
        for removal since 1.4.0. Use of(CommandArgument, ArgumentDescription) instead.
        Creates a new CommandComponent with the provided argument and description
        Type Parameters:
        C - Command sender type
        Parameters:
        commandArgument - Command Component Argument
        commandDescription - Command Component Description
        Returns:
        new CommandComponent
      • of

        public static <C> @NonNull CommandComponent<C> of​(@NonNull CommandArgument<C,​?> commandArgument,
                                                          @NonNull ArgumentDescription commandDescription)
        Creates a new CommandComponent with the provided argument and description
        Type Parameters:
        C - Command sender type
        Parameters:
        commandArgument - Command Component Argument
        commandDescription - Command Component Description
        Returns:
        new CommandComponent