Class BooleanFlag<F extends WorldFlag<Boolean,​F>>

    • Constructor Detail

      • BooleanFlag

        protected BooleanFlag​(boolean value,
                              Message description)
        Construct a new flag instance.
        Parameters:
        value - Flag value
        description - Flag description
      • BooleanFlag

        protected BooleanFlag​(Message description)
        Construct a new boolean flag, with false as the default value.
        Parameters:
        description - Flag description
    • Method Detail

      • parse

        public F parse​(@NotNull
                       @NotNull String input)
                throws FlagParseException
        Description copied from class: WorldFlag
        Parse a string into a flag, and throw an exception in the case that the string does not represent a valid flag value. This instance won't change its state, but instead an instance holding the parsed flag value will be returned.
        Specified by:
        parse in class WorldFlag<Boolean,​F extends WorldFlag<Boolean,​F>>
        Parameters:
        input - String to parse.
        Returns:
        Parsed value, if valid.
        Throws:
        FlagParseException - If the value could not be parsed.
      • merge

        public F merge​(@NotNull
                       @NotNull Boolean newValue)
        Description copied from class: WorldFlag
        Merge this flag's value with another value and return an instance holding the merged value.
        Specified by:
        merge in class WorldFlag<Boolean,​F extends WorldFlag<Boolean,​F>>
        Parameters:
        newValue - New flag value.
        Returns:
        Flag containing parsed flag value.
      • getTabCompletions

        public Collection<String> getTabCompletions()
        Description copied from class: WorldFlag
        Get the tab completable values associated with the flag type, or an empty collection if tab completion isn't supported.
        Overrides:
        getTabCompletions in class WorldFlag<Boolean,​F extends WorldFlag<Boolean,​F>>
        Returns:
        Collection containing tab completable flag values