Class PropertyTypeInteger

java.lang.Object
com.pnfsoftware.jeb.core.properties.impl.PropertyTypeInteger
All Implemented Interfaces:
IPropertyType, IPropertyTypeInteger

public final class PropertyTypeInteger extends Object implements IPropertyTypeInteger
Integer property type with constraints.
  • Method Details

    • create

      public static PropertyTypeInteger create(int min, int max, Integer def)
      Create an integer property.
      Parameters:
      min - minimum value allowed
      max - maximum value allowed
      def - default value
      Returns:
      the property type
    • create

      public static PropertyTypeInteger create()
      Create an integer property type without constraints, whose default value is zero.
      Returns:
      the property type
    • create

      public static PropertyTypeInteger create(Integer def)
      Create an integer property type without constraints.
      Parameters:
      def - default value
      Returns:
      the property type
    • createPositive

      public static PropertyTypeInteger createPositive(Integer def)
      Create a positive integer property type.
      Parameters:
      def - the default value
      Returns:
      the property type
    • createPositiveOrZero

      public static PropertyTypeInteger createPositiveOrZero(Integer def)
      Create a positive or null integer property type.
      Parameters:
      def - the default value
      Returns:
      the property type
    • createNegative

      public static PropertyTypeInteger createNegative(Integer def)
      Create a negative integer property type.
      Parameters:
      def - the default value
      Returns:
      the property type
    • createNegativeOrZero

      public static PropertyTypeInteger createNegativeOrZero(Integer def)
      Create a negative or null integer property type.
      Parameters:
      def - the default value
      Returns:
      the property type
    • getMin

      public int getMin()
      Description copied from interface: IPropertyTypeInteger
      Get the minimum allowed integer value.
      Specified by:
      getMin in interface IPropertyTypeInteger
      Returns:
      the value
    • getMax

      public int getMax()
      Description copied from interface: IPropertyTypeInteger
      Get the maximum allowed integer value.
      Specified by:
      getMax in interface IPropertyTypeInteger
      Returns:
    • getName

      public String getName()
      Description copied from interface: IPropertyType
      Get the type name.
      Specified by:
      getName in interface IPropertyType
      Returns:
    • getDefault

      public Integer getDefault()
      Description copied from interface: IPropertyType
      Get the default value.
      Specified by:
      getDefault in interface IPropertyType
      Specified by:
      getDefault in interface IPropertyTypeInteger
      Returns:
      the default value, cannot be null
    • validate

      public boolean validate(Object value)
      Description copied from interface: IPropertyType
      Validate a property value.
      Specified by:
      validate in interface IPropertyType
      Parameters:
      value - the property value
      Returns:
      true on success
    • afterRead

      public Object afterRead(IPropertyDefinition def, Object value)
      Description copied from interface: IPropertyType
      Post-processing to be done after reading a value. This method should only be called after a successful call to IPropertyType.validate(Object).
      Specified by:
      afterRead in interface IPropertyType
      value - must not be null
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object