Class NumberFlag<N extends Number & Comparable<N>,​F extends PlotFlag<N,​F>>

java.lang.Object
com.plotsquared.core.plot.flag.PlotFlag<N,​F>
com.plotsquared.core.plot.flag.types.NumberFlag<N,​F>
Direct Known Subclasses:
DoubleFlag, IntegerFlag, LongFlag

public abstract class NumberFlag<N extends Number & Comparable<N>,​F extends PlotFlag<N,​F>> extends PlotFlag<N,​F>
  • Field Details

  • Constructor Details

    • NumberFlag

      protected NumberFlag(@NonNull N value, N minimum, N maximum, @NonNull Caption flagCategory, @NonNull Caption flagDescription)
  • Method Details

    • parse

      public F parse(@NonNull String input) throws FlagParseException
      Description copied from class: PlotFlag
      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 PlotFlag<N extends Number & Comparable<N>,​F extends PlotFlag<N,​F>>
      Parameters:
      input - String to parse.
      Returns:
      Parsed value, if valid.
      Throws:
      FlagParseException - If the value could not be parsed.
    • parseNumber

      protected abstract @NonNull N parseNumber(String input) throws FlagParseException
      Parse the raw string input to the number type.
      Parameters:
      input - the string to parse the number from.
      Returns:
      the parsed number.
      Throws:
      FlagParseException - if the number couldn't be parsed.