public static final class DurationPropertyDefinition.Builder extends PropertyDefinition.AbstractBuilder<Long,DurationPropertyDefinition>
Modifier and Type | Method and Description |
---|---|
protected DurationPropertyDefinition |
buildInstance(AbstractManagedObjectDefinition<?,?> d,
String propertyName,
EnumSet<PropertyOption> options,
AdministratorAction adminAction,
DefaultBehaviorProvider<Long> defaultBehavior)
Build a property definition based on the properties of this builder.
|
void |
setAllowUnlimited(boolean allowUnlimited)
Specify whether this property definition will allow unlimited values (default is false).
|
void |
setBaseUnit(DurationUnit unit)
Set the base unit for this property definition (values including
limits are specified in this unit).
|
void |
setBaseUnit(String unit)
Set the base unit for this property definition (values including limits are specified in this unit).
|
void |
setLowerLimit(long lowerLimit)
Set the lower limit in milli-seconds.
|
void |
setLowerLimit(String lowerLimit)
Set the lower limit using a string representation of the limit.
|
void |
setMaximumUnit(DurationUnit unit)
Set the maximum unit for this property definition.
|
void |
setMaximumUnit(String unit)
Set the maximum unit for this property definition.
|
void |
setUpperLimit(Long upperLimit)
Set the upper limit in milli-seconds.
|
void |
setUpperLimit(String upperLimit)
Set the upper limit using a string representation of the limit.
|
getInstance, setAdministratorAction, setDefaultBehaviorProvider, setOption
public final void setBaseUnit(String unit)
unit
- The string representation of the base unit (must not be null
).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.public final void setBaseUnit(DurationUnit unit)
unit
- The base unit (must not be null
).IllegalArgumentException
- If the provided base unit is bigger than the maximum unit.public final void setMaximumUnit(String unit)
unit
- The string representation of the maximum unit, or
null
if there should not be a maximum unit.IllegalArgumentException
- If the provided unit name did not correspond to a known
duration unit, or if the maximum unit is smaller than the
base unit.public final void setMaximumUnit(DurationUnit unit)
unit
- The maximum unit, or null
if there should not be a maximum unit.IllegalArgumentException
- If the provided maximum unit is smaller than the base unit.public final void setLowerLimit(long lowerLimit)
lowerLimit
- The new lower limit (must be >= 0
) in milli-seconds.IllegalArgumentException
- If a negative lower limit was specified, or the lower
limit is greater than the upper limit.public final void setLowerLimit(String lowerLimit)
lowerLimit
- The string representation of the new lower limit.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.public final void setUpperLimit(Long upperLimit)
upperLimit
- The new upper limit in milli-seconds, or null
if there is no upper limit.IllegalArgumentException
- If a negative upper limit was specified,
or the lower limit is greater than the upper limit or unlimited durations are permitted.public final void setUpperLimit(String upperLimit)
upperLimit
- The string representation of the new upper limit, or null
if there is no upper limit.IllegalArgumentException
- If the upper limit could not be parsed, or if the lower limit is greater than the upper limit.public final void setAllowUnlimited(boolean allowUnlimited)
allowUnlimited
- true
if the property will allow unlimited values, or false
otherwise.IllegalArgumentException
- If unlimited values are to be permitted but there is an upper limit specified.protected DurationPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?,?> d, String propertyName, EnumSet<PropertyOption> options, AdministratorAction adminAction, DefaultBehaviorProvider<Long> defaultBehavior)
PropertyDefinition.AbstractBuilder
buildInstance
in class PropertyDefinition.AbstractBuilder<Long,DurationPropertyDefinition>
d
- The managed object definition associated with this
property definition.propertyName
- The property name.options
- Options applicable to this definition.adminAction
- The administrator action.defaultBehavior
- The default behavior provider.Copyright 2010-2018 ForgeRock AS.