Class ResourceLimitsPeriod


  • public class ResourceLimitsPeriod
    extends Object
    The period definition corresponding to a resource limit for a tenant.
    • Field Detail

      • PERIOD_MODE_DAYS

        public static final String PERIOD_MODE_DAYS
        The name of the constantly recurring accounting period mode.
        See Also:
        Constant Field Values
      • PERIOD_MODE_MONTHLY

        public static final String PERIOD_MODE_MONTHLY
        The name of the monthly recurring accounting period mode.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceLimitsPeriod

        public ResourceLimitsPeriod​(String mode)
        Creates a new instance with a given mode of recurrence.
        Parameters:
        mode - The mode of recurrence.
        Throws:
        NullPointerException - if mode is null.
    • Method Detail

      • isSupportedMode

        public static boolean isSupportedMode​(String mode)
        Checks if a given mode is one of the supported standard modes.
        Parameters:
        mode - The mode to check.
        Returns:
        true if the mode is one of the standard modes.
      • getMode

        public final String getMode()
        Gets the mode of period for resource limit calculation.
        Returns:
        The mode of period for resource limit calculation.
      • getNoOfDays

        public final int getNoOfDays()
        Gets the number of days for which resource usage is calculated.
        Returns:
        The number of days for a resource limit calculation.
      • setNoOfDays

        public final ResourceLimitsPeriod setNoOfDays​(int noOfDays)
        Sets the number of days for which resource usage is calculated.
        Parameters:
        noOfDays - The number of days for which resource usage is calculated.
        Returns:
        a reference to this for fluent use.
        Throws:
        IllegalArgumentException - if the number of days is <= 0.