Enum UploadStrategy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UploadStrategy>

    public enum UploadStrategy
    extends java.lang.Enum<UploadStrategy>
    The chunk mode to use when uploading
    Since:
    12687 (moved from gui.io package)
    • Constructor Detail

      • UploadStrategy

        private UploadStrategy​(java.lang.String preferenceValue)
    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromPreference

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

        public java.lang.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