Package io.realm.mongodb.sync
Enum ProgressMode
- java.lang.Object
-
- java.lang.Enum<ProgressMode>
-
- io.realm.mongodb.sync.ProgressMode
-
- All Implemented Interfaces:
Serializable
,Comparable<ProgressMode>
public enum ProgressMode extends Enum<ProgressMode>
Enum describing how to listen to progress changes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CURRENT_CHANGES
When registering theProgressListener
, it will record the current size of changes, and will only continue to report progress updates until those changes have been either downloaded or uploaded.INDEFINITELY
AProgressListener
registered in this mode, will continue to report progress changes, even if changes are being added after the listener was registered.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ProgressMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static ProgressMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CURRENT_CHANGES
public static final ProgressMode CURRENT_CHANGES
When registering theProgressListener
, it will record the current size of changes, and will only continue to report progress updates until those changes have been either downloaded or uploaded. After that the progress listener will not report any further changes.This means that listeners registered in this mode should be done before changes are written to the Realm.
Progress reported in this mode will only ever increase.
This is useful when e.g. reporting progress when downloading a Realm for the first time.
-
INDEFINITELY
public static final ProgressMode INDEFINITELY
AProgressListener
registered in this mode, will continue to report progress changes, even if changes are being added after the listener was registered.Progress reported in this mode can both increase and decrease, e.g. if large amounts of data is written after registering the listener.
This is useful when you want to track if all changes have been uploaded to the server from the device.
-
-
Method Detail
-
values
public static ProgressMode[] 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 (ProgressMode c : ProgressMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProgressMode 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 nameNullPointerException
- if the argument is null
-
-