Class DurationPropertyDefinition.Builder

    • Method Detail

      • setBaseUnit

        public void setBaseUnit​(String unit)
        Set the base unit for this property definition (values including limits are specified in this unit). By default a duration property definition uses seconds.
        Parameters:
        unit - The string representation of the base unit (must not be null).
        Throws:
        IllegalArgumentException - If the provided unit name did not correspond to a known duration unit, or if the base unit is bigger than the maximum unit.
      • setBaseUnit

        public void setBaseUnit​(com.forgerock.opendj.util.DurationUnit unit)
        Set the base unit for this property definition (values including limits are specified in this unit). By default a duration property definition uses seconds.
        Parameters:
        unit - The base unit (must not be null).
        Throws:
        IllegalArgumentException - If the provided base unit is bigger than the maximum unit.
      • setLowerLimit

        public void setLowerLimit​(long lowerLimit)
        Set the lower limit in milli-seconds.
        Parameters:
        lowerLimit - The new lower limit (must be >= 0) in milli-seconds.
        Throws:
        IllegalArgumentException - If a negative lower limit was specified, or the lower limit is greater than the upper limit.
      • setLowerLimit

        public void setLowerLimit​(String lowerLimit)
        Set the lower limit using a string representation of the limit. If the string does not specify a unit, the current base unit will be used.
        Parameters:
        lowerLimit - The string representation of the new lower limit.
        Throws:
        IllegalArgumentException - If the lower limit could not be parsed, or if a negative lower limit was specified, or the lower limit is greater than the upper limit.
      • setUpperLimit

        public void setUpperLimit​(Long upperLimit)
        Set the upper limit in milli-seconds.
        Parameters:
        upperLimit - The new upper limit in milli-seconds, or null if there is no upper limit.
        Throws:
        IllegalArgumentException - If a negative upper limit was specified, or the lower limit is greater than the upper limit or unlimited durations are permitted.
      • setUpperLimit

        public void setUpperLimit​(String upperLimit)
        Set the upper limit using a string representation of the limit. If the string does not specify a unit, the current base unit will be used.
        Parameters:
        upperLimit - The string representation of the new upper limit, or null if there is no upper limit.
        Throws:
        IllegalArgumentException - If the upper limit could not be parsed, or if the lower limit is greater than the upper limit.
      • setAllowUnlimited

        public void setAllowUnlimited​(boolean allowUnlimited)
        Specify whether this property definition will allow unlimited values (default is false).
        Parameters:
        allowUnlimited - true if the property will allow unlimited values, or false otherwise.
        Throws:
        IllegalArgumentException - If unlimited values are to be permitted but there is an upper limit specified.