public class Duration extends Object implements Operand
Duration duration = Duration.days(5.0);
to get a duration objectLogicCriteria
Modifier and Type | Class and Description |
---|---|
static class |
Duration.Units |
Modifier and Type | Method and Description |
---|---|
static Duration |
days(Double duration)
Returns a duration for the given number of days
|
static Duration |
days(int duration)
Returns a duration for the given number of days
|
Double |
getDuration() |
Double |
getDurationInDays()
Returns the equivalent duration in days
|
long |
getDurationInMillis()
Returns the equivalent duration in milliseconds
|
Duration.Units |
getUnits() |
static Duration |
hours(Double duration)
Returns a duration for the given number of hours
|
static Duration |
hours(int duration)
Returns a duration for the given number of hours
|
static Duration |
minutes(Double duration)
Returns a duration for the given number of minutes
|
static Duration |
minutes(int duration)
Returns a duration for the given number of minutes
|
static Duration |
months(Double duration)
Returns a duration for the given number of months
|
static Duration |
months(int duration)
Returns a duration for the given number of months
|
static Duration |
seconds(Double duration)
Returns a duration for the given number of seconds
|
static Duration |
seconds(int duration)
Returns a duration for the given number of seconds
|
boolean |
supports(ComparisonOperator operator)
Sanity check for this Operand vs a given operator.
|
static Duration |
weeks(Double duration)
Returns a duration for the given number of weeks
|
static Duration |
weeks(int duration)
Returns a duration for the given number of weeks
|
static Duration |
years(Double duration)
Returns a duration for the given number of years
|
static Duration |
years(int duration)
Returns a duration for the given number of years
|
public Double getDuration()
public Duration.Units getUnits()
public Double getDurationInDays()
public long getDurationInMillis()
public static Duration seconds(Double duration)
duration
- number of seconds for durationDuration
object for given number of secondspublic static Duration seconds(int duration)
duration
- number of seconds for durationDuration
object for given number of secondspublic static Duration minutes(Double duration)
duration
- number of minutes for durationDuration
object for given number of minutespublic static Duration minutes(int duration)
duration
- number of minutes for durationDuration
object for given number of minutespublic static Duration hours(Double duration)
duration
- number of hours for durationDuration
object for given number of hourspublic static Duration hours(int duration)
duration
- number of hours for durationDuration
object for given number of hourspublic static Duration days(Double duration)
duration
- number of days for durationDuration
object with specified number of dayspublic static Duration days(int duration)
duration
- number of days for durationDuration
object with specified number of dayspublic static Duration weeks(Double duration)
duration
- number of weeks for durationDuration
object with specified number of weekspublic static Duration weeks(int duration)
duration
- number of weeks for durationDuration
object with specified number of weekspublic static Duration months(Double duration)
duration
- number of months for durationDuration
object with specified number of monthspublic static Duration months(int duration)
duration
- number of months for durationDuration
object with specified number of monthspublic static Duration years(Double duration)
duration
- number of years for durationDuration
object with specified number of yearspublic static Duration years(int duration)
duration
- number of years for durationDuration
object with specified number of yearspublic boolean supports(ComparisonOperator operator)
Operand
supports
in interface Operand
operator
- The operator to test against this OperandComparisonOperator
Operand.supports(org.openmrs.logic.op.ComparisonOperator)
Copyright © 2024 OpenMRS Inc.. All rights reserved.