Package org.nuxeo.ecm.core.work.api
Class Work.Progress
- java.lang.Object
-
- org.nuxeo.ecm.core.work.api.Work.Progress
-
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- Work
public static class Work.Progress extends Object implements Serializable
A progress report about a work instance.Progress can be expressed as a percentage, or with a current and total count.
- 26.2% (percent not indeterminate)
- 12/345 (current not indeterminate)
- ?/345 (percent and current indeterminate but total non-zero)
- ? (percent and current indeterminate and total zero)
- Since:
- 5.6
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected long
current
static long
CURRENT_INDETERMINATE
protected float
percent
static float
PERCENT_INDETERMINATE
static Work.Progress
PROGRESS_0_PC
static Work.Progress
PROGRESS_100_PC
static Work.Progress
PROGRESS_INDETERMINATE
protected long
total
-
Constructor Summary
Constructors Constructor Description Progress(float percent)
Constructs aWork.Progress
as a percentage.Progress(long current, long total)
Constructs aWork.Progress
as a current and total count.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCurrent()
boolean
getIsIndeterminate()
boolean
getIsWithCurrentAndTotal()
boolean
getIsWithPercent()
float
getPercent()
long
getTotal()
String
toString()
-
-
-
Field Detail
-
CURRENT_INDETERMINATE
public static final long CURRENT_INDETERMINATE
- See Also:
- Constant Field Values
-
PERCENT_INDETERMINATE
public static final float PERCENT_INDETERMINATE
- See Also:
- Constant Field Values
-
PROGRESS_INDETERMINATE
public static final Work.Progress PROGRESS_INDETERMINATE
-
PROGRESS_0_PC
public static final Work.Progress PROGRESS_0_PC
-
PROGRESS_100_PC
public static final Work.Progress PROGRESS_100_PC
-
percent
protected final float percent
-
current
protected final long current
-
total
protected final long total
-
-
Constructor Detail
-
Progress
public Progress(float percent)
Constructs aWork.Progress
as a percentage.- Parameters:
percent
- the percentage, a float between 0 and 100, orPERCENT_INDETERMINATE
-
Progress
public Progress(long current, long total)
Constructs aWork.Progress
as a current and total count.- Parameters:
current
- the current count orCURRENT_INDETERMINATE
total
- the total count
-
-
Method Detail
-
getPercent
public float getPercent()
-
getCurrent
public long getCurrent()
-
getTotal
public long getTotal()
-
getIsWithPercent
public boolean getIsWithPercent()
-
getIsWithCurrentAndTotal
public boolean getIsWithCurrentAndTotal()
-
getIsIndeterminate
public boolean getIsIndeterminate()
-
-