Class FileBoolean


  • public class FileBoolean
    extends Object
    Uses a presence/absence of a file as a persisted boolean storage.

    This is convenient when you need to store just a few bits of infrequently accessed information as you can forget the explicit persistence of it. This class masks I/O problem, so if the persistence fails, you'll get no error report.

    Since:
    1.498
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • FileBoolean

        public FileBoolean​(File file)
      • FileBoolean

        public FileBoolean​(Class owner,
                           String name)
    • Method Detail

      • get

        public boolean get()
        Gets the current state. True if the file exists, false if it doesn't.
      • fastGet

        public boolean fastGet()
        Like get() except instead of checking the actual file, use the result from the last get() call.
      • isOn

        public boolean isOn()
      • isOff

        public boolean isOff()
      • set

        public void set​(boolean b)
      • on

        public void on()
      • off

        public void off()