Interface IBitFlag

All Known Implementing Classes:
IStorage.StructureFlag

public interface IBitFlag
Represents a bitflag utility.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static long
    changeFlag(long flagValue, boolean enabled, long currentValue)
    Sets the value of a flag to either on or off.
    static boolean
    hasFlag(long flagValue, long currentValue)
    Checks if a given flag is enabled
    static long
    setFlag(long flagValue, long currentValue)
    Enables a flag if not previously enabled.
    static long
    unsetFlag(long flagValue, long currentValue)
    Sets the value of a flag to either off.
  • Method Details

    • changeFlag

      static long changeFlag(long flagValue, boolean enabled, long currentValue)
      Sets the value of a flag to either on or off.
      Parameters:
      flagValue - The value of the flag.
      enabled - Whether or not this flag will be on.
      currentValue - The current value of the flag(s).
      Returns:
      The new value of the flag(s).
    • setFlag

      static long setFlag(long flagValue, long currentValue)
      Enables a flag if not previously enabled.
      Parameters:
      flagValue - The value of the flag.
      currentValue - The current value of the flag(s).
      Returns:
      The new value of the flag(s).
    • unsetFlag

      static long unsetFlag(long flagValue, long currentValue)
      Sets the value of a flag to either off.
      Parameters:
      flagValue - The value of the flag.
      currentValue - The current value of the flag(s).
      Returns:
      The new value of the flag(s).
    • hasFlag

      static boolean hasFlag(long flagValue, long currentValue)
      Checks if a given flag is enabled
      Parameters:
      flagValue - The value of the flag.
      currentValue - The value of the current flag(s).
      Returns:
      True if the flag is enabled.