Package com.xpn.xwiki.criteria.impl
Class DurationFactory
- java.lang.Object
-
- com.xpn.xwiki.criteria.impl.DurationFactory
-
public class DurationFactory extends Object
Helper factory class for creating Duration objects in velocity.
-
-
Constructor Summary
Constructors Constructor Description DurationFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Duration
createDays(int days)
Creates a new Duration instance having just the specified number of days.static Duration
createDuration(int years, int months, int weeks, int days)
static Duration
createMonths(int months)
Creates a new Duration instance having just the specified number of months.static Duration
createWeeks(int weeks)
Creates a new Duration instance having just the specified number of weeks.static Duration
createYears(int years)
Creates a new Duration instance having just the specified number of years.static Duration
getDAY()
Helper method for accessingDAY
static field in velocity.static Duration
getMONTH()
Helper method for accessingMONTH
static field in velocity.static Duration
getWEEK()
Helper method for accessingWEEK
static field in velocity.static Duration
getYEAR()
Helper method for accessingYEAR
static field in velocity.
-
-
-
Method Detail
-
createDuration
public static Duration createDuration(int years, int months, int weeks, int days)
- See Also:
Duration(int, int, int, int)
-
createDays
public static Duration createDays(int days)
Creates a new Duration instance having just the specified number of days. All the other fields are 0.- Parameters:
days
- The number of days- Returns:
- A new Duration instance
-
createWeeks
public static Duration createWeeks(int weeks)
Creates a new Duration instance having just the specified number of weeks. All the other fields are 0.- Parameters:
weeks
- The number of weeks- Returns:
- A new Duration instance
-
createMonths
public static Duration createMonths(int months)
Creates a new Duration instance having just the specified number of months. All the other fields are 0.- Parameters:
months
- The number of months- Returns:
- A new Duration instance
-
createYears
public static Duration createYears(int years)
Creates a new Duration instance having just the specified number of years. All the other fields are 0.- Parameters:
years
- The number of years- Returns:
- A new Duration instance
-
getMONTH
public static Duration getMONTH()
Helper method for accessingMONTH
static field in velocity.
-
-