Package org.openstreetmap.josm.io
Enum UploadStrategy
- java.lang.Object
-
- java.lang.Enum<UploadStrategy>
-
- org.openstreetmap.josm.io.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.iopackage)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CHUNKED_DATASET_STRATEGYUpload the objects in junks of n objects using m diff uploadsINDIVIDUAL_OBJECTS_STRATEGYUploads the objects individually, one request per objectSINGLE_REQUEST_STRATEGYUpload the objects in one request using 1 diff upload
-
Field Summary
Fields Modifier and Type Field Description static UploadStrategyDEFAULT_UPLOAD_STRATEGYthe default upload strategyprivate java.lang.StringpreferenceValue
-
Constructor Summary
Constructors Modifier Constructor Description privateUploadStrategy(java.lang.String preferenceValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UploadStrategyfromPreference(java.lang.String preferenceValue)Reads the value from preferencesstatic UploadStrategygetFromPreferences()Replies the upload strategy currently configured in the preferences.java.lang.StringgetPreferenceValue()Replies the value which is written to the preferences for a specific upload strategystatic voidsaveToPreferences(UploadStrategy strategy)Saves the upload strategystrategyto the preferences.static UploadStrategyvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static UploadStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INDIVIDUAL_OBJECTS_STRATEGY
public static final UploadStrategy INDIVIDUAL_OBJECTS_STRATEGY
Uploads the objects individually, one request per object
-
CHUNKED_DATASET_STRATEGY
public static final UploadStrategy CHUNKED_DATASET_STRATEGY
Upload the objects in junks of n objects using m diff uploads
-
SINGLE_REQUEST_STRATEGY
public static final UploadStrategy SINGLE_REQUEST_STRATEGY
Upload the objects in one request using 1 diff upload
-
-
Field Detail
-
preferenceValue
private final java.lang.String preferenceValue
-
DEFAULT_UPLOAD_STRATEGY
public static final UploadStrategy DEFAULT_UPLOAD_STRATEGY
the default upload strategy
-
-
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 namejava.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
UploadStrategyfor that preference ornullif 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 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
public static void saveToPreferences(UploadStrategy strategy)
Saves the upload strategystrategyto the preferences.- Parameters:
strategy- the strategy to save
-
-