Package org.openstreetmap.josm.io
Enum Class UploadStrategy
- All Implemented Interfaces:
Serializable,Comparable<UploadStrategy>,Constable
The chunk mode to use when uploading
- Since:
- 12687 (moved from
gui.iopackage)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUpload the objects in junks of n objects using m diff uploadsUploads the objects individually, one request per objectUpload the objects in one request using 1 diff upload -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UploadStrategythe default upload strategyprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UploadStrategyfromPreference(String preferenceValue) Reads the value from preferencesstatic UploadStrategyReplies the upload strategy currently configured in the preferences.Replies the value which is written to the preferences for a specific upload strategystatic voidsaveToPreferences(UploadStrategy strategy) Saves the upload strategystrategyto the preferences.static UploadStrategyReturns the enum constant of this class with the specified name.static UploadStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INDIVIDUAL_OBJECTS_STRATEGY
Uploads the objects individually, one request per object -
CHUNKED_DATASET_STRATEGY
Upload the objects in junks of n objects using m diff uploads -
SINGLE_REQUEST_STRATEGY
Upload the objects in one request using 1 diff upload
-
-
Field Details
-
preferenceValue
-
DEFAULT_UPLOAD_STRATEGY
the default upload strategy
-
-
Constructor Details
-
UploadStrategy
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
fromPreference
Reads the value from preferences- Parameters:
preferenceValue- The preference value- Returns:
- The
UploadStrategyfor that preference ornullif unknown
-
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
Replies the upload strategy currently configured in the preferences. Checks for the preference keyosm-server.upload-strategy
. If missing or if the preference value is illegal,DEFAULT_UPLOAD_STRATEGYis replied.- Returns:
- the upload strategy currently configured in the preferences.
-
saveToPreferences
Saves the upload strategystrategyto the preferences.- Parameters:
strategy- the strategy to save
-