Class DurationFactory


  • public class DurationFactory
    extends Object
    Helper factory class for creating Duration objects in velocity.
    • Field Detail

      • DAY

        public static final Duration DAY
        A duration of exactly one day.
      • WEEK

        public static final Duration WEEK
        A duration of exactly one week.
      • MONTH

        public static final Duration MONTH
        A duration of exactly one month
      • YEAR

        public static final Duration YEAR
        A duration of exactly one year.
    • Constructor Detail

      • DurationFactory

        public DurationFactory()
    • Method Detail

      • 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
      • getDAY

        public static Duration getDAY()
        Helper method for accessing DAY static field in velocity.
      • getWEEK

        public static Duration getWEEK()
        Helper method for accessing WEEK static field in velocity.
      • getMONTH

        public static Duration getMONTH()
        Helper method for accessing MONTH static field in velocity.
      • getYEAR

        public static Duration getYEAR()
        Helper method for accessing YEAR static field in velocity.