Package org.sonar.api.utils.internal
Class WorkDuration
- java.lang.Object
-
- org.sonar.api.utils.internal.WorkDuration
-
- All Implemented Interfaces:
java.io.Serializable
public class WorkDuration extends java.lang.Object implements java.io.Serializable
- Since:
- 4.2
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkDuration.UNIT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkDuration
add(WorkDuration with)
static WorkDuration
create(int days, int hours, int minutes, int hoursInDay)
static WorkDuration
createFromValueAndUnit(int value, WorkDuration.UNIT unit, int hoursInDay)
int
days()
boolean
equals(java.lang.Object o)
int
hashCode()
int
hours()
int
minutes()
WorkDuration
multiply(int factor)
WorkDuration
subtract(WorkDuration with)
long
toLong()
Return the duration using the following format DDHHMM, where DD is the number of days, HH is the number of months, and MM the number of minutes.long
toMinutes()
java.lang.String
toString()
double
toWorkingDays()
Return the duration in number of working days.
-
-
-
Method Detail
-
create
public static WorkDuration create(int days, int hours, int minutes, int hoursInDay)
-
createFromValueAndUnit
public static WorkDuration createFromValueAndUnit(int value, WorkDuration.UNIT unit, int hoursInDay)
-
toWorkingDays
public double toWorkingDays()
Return the duration in number of working days. For instance, 3 days and 4 hours will return 3.5 days (if hoursIndDay is 8).
-
toLong
public long toLong()
Return the duration using the following format DDHHMM, where DD is the number of days, HH is the number of months, and MM the number of minutes. For instance, 3 days and 4 hours will return 030400 (if hoursIndDay is 8).
-
toMinutes
public long toMinutes()
-
add
public WorkDuration add(@Nullable WorkDuration with)
-
subtract
public WorkDuration subtract(@Nullable WorkDuration with)
-
multiply
public WorkDuration multiply(int factor)
-
days
public int days()
-
hours
public int hours()
-
minutes
public int minutes()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-