java.lang.Object
com.plotsquared.core.plot.flag.PlotFlag<PlotWeather,​WeatherFlag>
com.plotsquared.core.plot.flag.implementations.WeatherFlag

public class WeatherFlag extends PlotFlag<PlotWeather,​WeatherFlag>
  • Field Details

    • PLOT_WEATHER_FLAG_RAIN

      public static final WeatherFlag PLOT_WEATHER_FLAG_RAIN
    • PLOT_WEATHER_FLAG_CLEAR

      public static final WeatherFlag PLOT_WEATHER_FLAG_CLEAR
    • PLOT_WEATHER_FLAG_WORLD

      public static final WeatherFlag PLOT_WEATHER_FLAG_WORLD
    • PLOT_WEATHER_FLAG_OFF

      public static final WeatherFlag PLOT_WEATHER_FLAG_OFF
  • Constructor Details

    • WeatherFlag

      protected WeatherFlag(@NonNull PlotWeather value)
      Construct a new flag instance.
      Parameters:
      value - Flag value
  • Method Details

    • parse

      public WeatherFlag parse(@NonNull String input)
      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<PlotWeather,​WeatherFlag>
      Parameters:
      input - String to parse.
      Returns:
      Parsed value, if valid.
    • merge

      public WeatherFlag merge(@NonNull PlotWeather newValue)
      Description copied from class: PlotFlag
      Merge this flag's value with another value and return an instance holding the merged value.
      Specified by:
      merge in class PlotFlag<PlotWeather,​WeatherFlag>
      Parameters:
      newValue - New flag value.
      Returns:
      Flag containing parsed flag value.
    • toString

      public String toString()
      Description copied from class: PlotFlag
      Returns a string representation of the flag instance, that when passed through PlotFlag.parse(String) will result in an equivalent instance of the flag.
      Specified by:
      toString in class PlotFlag<PlotWeather,​WeatherFlag>
      Returns:
      String representation of the flag
    • getExample

      public String getExample()
      Description copied from class: PlotFlag
      An example of a string that would parse into a valid flag value.
      Specified by:
      getExample in class PlotFlag<PlotWeather,​WeatherFlag>
      Returns:
      An example flag value.
    • flagOf

      protected WeatherFlag flagOf(@NonNull PlotWeather value)
      Specified by:
      flagOf in class PlotFlag<PlotWeather,​WeatherFlag>
    • getTabCompletions

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