Package org.jppf.utils.configuration
Class NumberProperty<T extends Number>
java.lang.Object
org.jppf.utils.configuration.AbstractJPPFProperty<T>
org.jppf.utils.configuration.NumberProperty<T>
- Type Parameters:
T- the type of the value of this property.
- All Implemented Interfaces:
Serializable,JPPFProperty<T>
- Direct Known Subclasses:
DoubleProperty,FloatProperty,IntProperty,LongProperty
Implementation of
JPPFProperty for numeric properties.
Instances of this class or its subclasses manage a minimum and maximum accepted value for numeric properties.- Since:
- 5.2
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNumberProperty(String name, T defaultValue, String... aliases) Initialize this property with the specified name and default value.Initialize this property with the specified name and default value. -
Method Summary
Modifier and TypeMethodDescriptionGet the maximum accepted value for this property.Get the minimum accepted value for this property.booleanWhether this property has a min and max values.Methods inherited from class org.jppf.utils.configuration.AbstractJPPFProperty
getAliases, getDefaultValue, getDeprecatedDoc, getDeprecatedDoc, getDocumentation, getDocumentation, getI18nBase, getName, getParameterDoc, getParameters, getPossibleValues, getShortLabel, getShortLabel, getTags, isDeprecated, resolveName, resolveName, setDeprecated, setI18nBase, setPossibleValues, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.utils.configuration.JPPFProperty
valueOf, valueType
-
Constructor Details
-
NumberProperty
Initialize this property with the specified name and default value.- Parameters:
name- the name of this property.defaultValue- the default value of this property, used when the proeprty is not defined.aliases- other names that may be given to this property (e.g. older names from previous versions).
-
NumberProperty
Initialize this property with the specified name and default value.- Parameters:
name- the name of this property.defaultValue- the default value of this property, used when the proeprty is not defined.aliases- other names that may be given to this property (e.g. older names from previous versions).minValue- the minimum accepted value for this property.maxValue- the maximum accepted value for this property.
-
-
Method Details
-
getMinValue
Get the minimum accepted value for this property.- Returns:
- the minimum value.
-
getMaxValue
Get the maximum accepted value for this property.- Returns:
- the maximum value.
-
hasMinAndMax
public boolean hasMinAndMax()Whether this property has a min and max values.- Returns:
trueif min and max values are defined,falseotherwise.
-