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

public abstract class NumberProperty<T extends Number> extends AbstractJPPFProperty<T>
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 Details

    • NumberProperty

      public NumberProperty(String name, T defaultValue, String... aliases)
      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

      public NumberProperty(String name, T defaultValue, T minValue, T maxValue, String... aliases)
      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

      public T getMinValue()
      Get the minimum accepted value for this property.
      Returns:
      the minimum value.
    • getMaxValue

      public T 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:
      true if min and max values are defined, false otherwise.