Enum UploadStrategy

    • Method Detail

      • values

        public static UploadStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UploadStrategy c : UploadStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UploadStrategy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • fromPreference

        public static UploadStrategy fromPreference​(String preferenceValue)
        Reads the value from preferences
        Parameters:
        preferenceValue - The preference value
        Returns:
        The UploadStrategy for that preference or null if unknown
      • getPreferenceValue

        public String getPreferenceValue()
        Replies the value which is written to the preferences for a specific upload strategy
        Returns:
        the value which is written to the preferences for a specific upload strategy
      • getFromPreferences

        public static UploadStrategy getFromPreferences()
        Replies the upload strategy currently configured in the preferences. Checks for the preference key
        osm-server.upload-strategy
        . If missing or if the preference value is illegal, DEFAULT_UPLOAD_STRATEGY is replied.
        Returns:
        the upload strategy currently configured in the preferences.
      • saveToPreferences

        public static void saveToPreferences​(UploadStrategy strategy)
        Saves the upload strategy strategy to the preferences.
        Parameters:
        strategy - the strategy to save