Class Command.Option

  • Enclosing class:
    Command

    public static class Command.Option
    extends java.lang.Object
    An Option for a command.
    • Constructor Detail

      • Option

        public Option​(@Nonnull
                      DataObject json)
    • Method Detail

      • getName

        @Nonnull
        public java.lang.String getName()
        The name of this option, subcommand, or subcommand group.
        Returns:
        The name
      • getDescription

        @Nonnull
        public java.lang.String getDescription()
        The description of this option, subcommand, or subcommand group.
        Returns:
        The description
      • getTypeRaw

        public int getTypeRaw()
        The raw option type.
        Returns:
        The type
      • isRequired

        public boolean isRequired()
        Whether this option is required
        Returns:
        True if this option is required
      • getChannelTypes

        @Nonnull
        public java.util.Set<ChannelType> getChannelTypes()
        The ChannelTypes this option is restricted to.
        This is empty if the option is not of type CHANNEL or not restricted to specific types.
        Returns:
        Immutable Set of ChannelType
      • getMinValue

        @Nullable
        public java.lang.Number getMinValue()
        The minimum value which can be provided for this option.
        This returns null if the value is not set or if the option is not of type INTEGER or NUMBER.
        Returns:
        The minimum value for this option or null
      • getMaxValue

        @Nullable
        public java.lang.Number getMaxValue()
        The maximum value which can be provided for this option.
        This returns null if the value is not set or if the option is not of type INTEGER or NUMBER.
        Returns:
        The maximum value for this option or null
      • getChoices

        @Nonnull
        public java.util.List<Command.Choice> getChoices()
        The predefined choices available for this option.
        If no choices are defined, this returns an empty list.
        Returns:
        Immutable List of Command.Choice
      • hashCode

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object