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

java.lang.Object
com.plotsquared.core.plot.flag.PlotFlag<Boolean,​F>
com.plotsquared.core.plot.flag.types.BooleanFlag<F>
Direct Known Subclasses:
AnimalAttackFlag, AnimalInteractFlag, BlockBurnFlag, BlockIgnitionFlag, ChatFlag, CopperOxideFlag, CoralDryFlag, CropGrowFlag, DenyExitFlag, DenyPortalsFlag, DenyPortalTravelFlag, DeviceInteractFlag, DisablePhysicsFlag, DropProtectionFlag, EntityChangeBlockFlag, ExplosionFlag, ForcefieldFlag, GrassGrowFlag, HangingBreakFlag, HangingPlaceFlag, HideInfoFlag, HostileAttackFlag, HostileInteractFlag, IceFormFlag, IceMeltFlag, InstabreakFlag, InvincibleFlag, ItemDropFlag, KeepInventoryFlag, KelpGrowFlag, LeafDecayFlag, LecternReadBookFlag, MiscBreakFlag, MiscInteractFlag, MiscPlaceFlag, MobBreakFlag, MobPlaceFlag, MycelGrowFlag, NotifyEnterFlag, NotifyLeaveFlag, NoWorldeditFlag, PlayerInteractFlag, PreventCreativeCopyFlag, PveFlag, PvpFlag, RedstoneFlag, ServerPlotFlag, SnowFormFlag, SnowMeltFlag, SoilDryFlag, TamedAttackFlag, TamedInteractFlag, UntrustedVisitFlag, VehicleBreakFlag, VehiclePlaceFlag, VehicleUseFlag, VillagerInteractFlag, VineGrowFlag

public abstract class BooleanFlag<F extends PlotFlag<Boolean,​F>> extends PlotFlag<Boolean,​F>
  • Constructor Details

    • BooleanFlag

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

      protected BooleanFlag(Caption description)
      Construct a new boolean flag, with false as the default value.
      Parameters:
      description - Flag description
  • 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<Boolean,​F extends PlotFlag<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(@NonNull Boolean 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<Boolean,​F extends PlotFlag<Boolean,​F>>
      Parameters:
      newValue - New flag value.
      Returns:
      Flag containing parsed flag value.
    • 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<Boolean,​F extends PlotFlag<Boolean,​F>>
      Returns:
      An example 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<Boolean,​F extends PlotFlag<Boolean,​F>>
      Returns:
      String representation of the flag
    • 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<Boolean,​F extends PlotFlag<Boolean,​F>>
      Returns:
      Collection containing tab completable flag values