Package org.vanted.updater
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 Summary
Constructors Constructor Description PreferencesUpdater()
-
Method Summary
Modifier and Type Method Description static boolean
checkAndUpdateLink(Preferences preferences, String key, String toRemove, String toUpdate)
Update any deeply stored preferences values.static boolean
checkAndUpdateMonashLink(Preferences preferences, String key, String toUpdate)
Deprecated.static boolean
isVersion(String version)
Check current version.
-
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 preferenceskey
- the key to get the valuetoUpdate
- 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 withisVersion(String)
to restrict to only it.- Parameters:
preferences
- the respective class preferenceskey
- the key to get the valuetoRemove
- the old value, can also be only partialtoUpdate
- the new value- Returns:
- true, if the link has been successfully updated
- Since:
- 2.6.5
-
isVersion
Check current version.- Parameters:
version
- to check- Returns:
- true if current equals version
-