Class FilePreferences

  • Direct Known Subclasses:
    FilePreferencesNode

    public abstract class FilePreferences
    extends java.util.prefs.AbstractPreferences
    Implements a Preferences that stores all values in a Storage instance.
    • Field Summary

      • Fields inherited from class java.util.prefs.AbstractPreferences

        lock, newNode
      • Fields inherited from class java.util.prefs.Preferences

        MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FilePreferences​(@Nullable java.util.prefs.AbstractPreferences parent, @NotNull java.lang.String name, @NotNull NodeType nodeType, @NotNull Storage storage)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected @NotNull java.lang.String @NotNull [] childrenNamesSpi()  
      protected java.util.prefs.AbstractPreferences childSpi​(@NotNull java.lang.String name)  
      void flush()  
      protected void flushSpi()  
      @Nullable java.lang.String get​(@NotNull java.lang.String key, @Nullable java.lang.String def)  
      boolean getBoolean​(@NotNull java.lang.String key, boolean def)  
      double getDouble​(@NotNull java.lang.String key, double def)  
      float getFloat​(@NotNull java.lang.String key, float def)  
      int getInt​(@NotNull java.lang.String key, int def)  
      long getLong​(@NotNull java.lang.String key, long def)  
      protected @Nullable java.lang.String getSpi​(@NotNull java.lang.String key)  
      protected @NotNull Storage getStorage()
      Returns the storage instance used for loading/saving values.
      protected @NotNull java.lang.String @NotNull [] keysSpi()  
      protected void putSpi​(@NotNull java.lang.String key, @NotNull java.lang.String value)  
      protected void removeNodeSpi()  
      protected void removeSpi​(@NotNull java.lang.String key)  
      void sync()  
      protected void syncSpi()  
      • Methods inherited from class java.util.prefs.AbstractPreferences

        absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, getByteArray, getChild, isRemoved, isUserNode, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, toString
      • Methods inherited from class java.util.prefs.Preferences

        importPreferences, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FilePreferences

        protected FilePreferences​(@Nullable
                                  @Nullable java.util.prefs.AbstractPreferences parent,
                                  @NotNull
                                  @NotNull java.lang.String name,
                                  @NotNull
                                  @NotNull NodeType nodeType,
                                  @NotNull
                                  @NotNull Storage storage)
        Creates a new instance.
        Parameters:
        parent - the parent node, or null if this node is the root node
        name - the name of this node
        nodeType - the node type of this node
        storage - the storage instance used for loading/saving values
    • Method Detail

      • getStorage

        @NotNull
        protected @NotNull Storage getStorage()
        Returns the storage instance used for loading/saving values.
        Returns:
        the storage instance
      • childrenNamesSpi

        @NotNull
        protected @NotNull java.lang.String @NotNull [] childrenNamesSpi()
        Specified by:
        childrenNamesSpi in class java.util.prefs.AbstractPreferences
      • childSpi

        protected java.util.prefs.AbstractPreferences childSpi​(@NotNull
                                                               @NotNull java.lang.String name)
        Specified by:
        childSpi in class java.util.prefs.AbstractPreferences
      • flushSpi

        protected void flushSpi()
        Specified by:
        flushSpi in class java.util.prefs.AbstractPreferences
      • flush

        public void flush()
                   throws java.util.prefs.BackingStoreException
        Overrides:
        flush in class java.util.prefs.AbstractPreferences
        Throws:
        java.util.prefs.BackingStoreException
        No Inspection:
        RefusedBequest
      • get

        @Nullable
        public @Nullable java.lang.String get​(@NotNull
                                              @NotNull java.lang.String key,
                                              @Nullable
                                              @Nullable java.lang.String def)
        Overrides:
        get in class java.util.prefs.AbstractPreferences
        No Inspection:
        RefusedBequest
      • getBoolean

        public boolean getBoolean​(@NotNull
                                  @NotNull java.lang.String key,
                                  boolean def)
        Overrides:
        getBoolean in class java.util.prefs.AbstractPreferences
      • getDouble

        public double getDouble​(@NotNull
                                @NotNull java.lang.String key,
                                double def)
        Overrides:
        getDouble in class java.util.prefs.AbstractPreferences
      • getFloat

        public float getFloat​(@NotNull
                              @NotNull java.lang.String key,
                              float def)
        Overrides:
        getFloat in class java.util.prefs.AbstractPreferences
      • getInt

        public int getInt​(@NotNull
                          @NotNull java.lang.String key,
                          int def)
        Overrides:
        getInt in class java.util.prefs.AbstractPreferences
      • getLong

        public long getLong​(@NotNull
                            @NotNull java.lang.String key,
                            long def)
        Overrides:
        getLong in class java.util.prefs.AbstractPreferences
      • getSpi

        @Nullable
        protected @Nullable java.lang.String getSpi​(@NotNull
                                                    @NotNull java.lang.String key)
        Specified by:
        getSpi in class java.util.prefs.AbstractPreferences
      • keysSpi

        @NotNull
        protected @NotNull java.lang.String @NotNull [] keysSpi()
        Specified by:
        keysSpi in class java.util.prefs.AbstractPreferences
      • putSpi

        protected void putSpi​(@NotNull
                              @NotNull java.lang.String key,
                              @NotNull
                              @NotNull java.lang.String value)
        Specified by:
        putSpi in class java.util.prefs.AbstractPreferences
      • removeNodeSpi

        protected void removeNodeSpi()
        Specified by:
        removeNodeSpi in class java.util.prefs.AbstractPreferences
      • removeSpi

        protected void removeSpi​(@NotNull
                                 @NotNull java.lang.String key)
        Specified by:
        removeSpi in class java.util.prefs.AbstractPreferences
      • syncSpi

        protected void syncSpi()
        Specified by:
        syncSpi in class java.util.prefs.AbstractPreferences
      • sync

        public void sync()
                  throws java.util.prefs.BackingStoreException
        Overrides:
        sync in class java.util.prefs.AbstractPreferences
        Throws:
        java.util.prefs.BackingStoreException
        No Inspection:
        RefusedBequest