Class PreferencesUpdater

java.lang.Object
org.vanted.updater.PreferencesUpdater

public class PreferencesUpdater
extends Object
Updates any previously stored old links from preferences. Created for version 2.6.4 during the transition period to force links update. It could be extended or re-used to force such deep updates, if needed.
Since:
2.6.4
Author:
D. Garkov
  • Constructor Details

    • PreferencesUpdater

      public PreferencesUpdater()
  • Method Details

    • checkAndUpdateMonashLink

      @Deprecated public static boolean checkAndUpdateMonashLink​(Preferences preferences, String key, String toUpdate)
      Deprecated.
      Checks for the current version and updates accordingly.
      Parameters:
      preferences - the respective class preferences
      key - the key to get the value
      toUpdate - the new value
      Returns:
      true, if the link has been successfully updated
    • checkAndUpdateLink

      public static boolean checkAndUpdateLink​(Preferences preferences, String key, String toRemove, String toUpdate)
      Update any deeply stored preferences values. To make sure there is no unnecessary propagation of changes into multiple versions, better check the version with isVersion(String) to restrict to only it.
      Parameters:
      preferences - the respective class preferences
      key - the key to get the value
      toRemove - the old value, can also be only partial
      toUpdate - the new value
      Returns:
      true, if the link has been successfully updated
      Since:
      2.6.5
    • isVersion

      public static boolean isVersion​(String version)
      Check current version.
      Parameters:
      version - to check
      Returns:
      true if current equals version