org.beanfabrics.model
Class IntegerPM
java.lang.Object
org.beanfabrics.AbstractBean
org.beanfabrics.ValidatableBean
org.beanfabrics.model.AbstractPM
org.beanfabrics.model.AbstractValuePM
org.beanfabrics.model.TextPM
org.beanfabrics.model.BigDecimalPM
org.beanfabrics.model.IntegerPM
- All Implemented Interfaces:
- Bean, ContextOwner, HasComparable, IBigDecimalPM, IIntegerPM, ITextPM, IValuePM, PresentationModel, Supportable, Validatable
public class IntegerPM
- extends BigDecimalPM
- implements IIntegerPM
The IntegerPM is a presentation model for integer numbers. The default range
for valid numbers is between Long.MIN_VALUE
and
Long.MAX_VALUE
.
Method Summary |
java.lang.Byte |
getByte()
Returns the value of this PM as a Byte . |
java.lang.Integer |
getInteger()
Returns the value of this PM as an Integer . |
java.lang.Long |
getLong()
Returns the value of this PM as a Long . |
long |
getMaxValue()
Returns the maximum numeric value that is valid for this PM's value. |
long |
getMinValue()
Returns the minimum numeric value that is valid for this PM's value. |
java.lang.Short |
getShort()
Returns the value of this PM as a Short . |
void |
setByte(java.lang.Byte value)
Sets the value if this PM to the given Byte . |
void |
setInteger(java.lang.Integer value)
Sets the value of this PM to the given Integer . |
void |
setLong(java.lang.Long value)
Sets the value of this PM to the given Long . |
void |
setMaxValue(long maxValue)
Sets the maximum numeric long value that is valid for this PM's value. |
void |
setMinMaxValueRange(long minValue,
long maxValue)
|
void |
setMinValue(long minValue)
Sets the minimum numeric long value that is valid for this PM's value. |
void |
setShort(java.lang.Short value)
Sets the value of this PM to the given Short . |
Methods inherited from class org.beanfabrics.model.BigDecimalPM |
createDefaultFormat, getBigDecimal, getBigInteger, getComparable, getDecimalFormat, getFormat, reformat, setBigDecimal, setBigInteger, setDefaultBigDecimal, setDefaultBigInteger, setFormat |
Methods inherited from class org.beanfabrics.model.TextPM |
getDefaultText, getOptions, getText, getText, isEmpty, isModified, isRestrictedToOptions, preset, reset, setDefaultText, setOptions, setRestrictedToOptions, setText |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_MESSAGE_VALUE_TOO_SMALL
protected static final java.lang.String KEY_MESSAGE_VALUE_TOO_SMALL
- See Also:
- Constant Field Values
KEY_MESSAGE_VALUE_TOO_BIG
protected static final java.lang.String KEY_MESSAGE_VALUE_TOO_BIG
- See Also:
- Constant Field Values
KEY_MESSAGE_INVALID_NUMBER
protected static final java.lang.String KEY_MESSAGE_INVALID_NUMBER
- See Also:
- Constant Field Values
IntegerPM
public IntegerPM()
IntegerPM
public IntegerPM(java.lang.Integer value)
getMinValue
public long getMinValue()
- Description copied from interface:
IIntegerPM
- Returns the minimum numeric value that is valid for this PM's value.
Implementors must ensure that the validation of this PM should evaluate
to invalid if the numeric value of this PM is less than the specified
minimum value.
- Specified by:
getMinValue
in interface IIntegerPM
- Returns:
- the minimum numeric value
setMinValue
public void setMinValue(long minValue)
- Description copied from interface:
IIntegerPM
- Sets the minimum numeric long value that is valid for this PM's value.
- Specified by:
setMinValue
in interface IIntegerPM
- Parameters:
minValue
- the minimum value- See Also:
IIntegerPM.getMinValue()
getMaxValue
public long getMaxValue()
- Description copied from interface:
IIntegerPM
- Returns the maximum numeric value that is valid for this PM's value.
Implementors must ensure that the validation of this PM should evaluate
to invalid if the numeric value of this PM is greater than the specified
maximum value.
- Specified by:
getMaxValue
in interface IIntegerPM
- Returns:
- the maximum numeric value
setMaxValue
public void setMaxValue(long maxValue)
- Description copied from interface:
IIntegerPM
- Sets the maximum numeric long value that is valid for this PM's value.
- Specified by:
setMaxValue
in interface IIntegerPM
- Parameters:
maxValue
- the maximum value- See Also:
IIntegerPM.getMaxValue()
setMinMaxValueRange
public void setMinMaxValueRange(long minValue,
long maxValue)
setByte
public void setByte(java.lang.Byte value)
- Description copied from interface:
IIntegerPM
- Sets the value if this PM to the given
Byte
.
- Specified by:
setByte
in interface IIntegerPM
- Parameters:
value
- the Byte value
getByte
public java.lang.Byte getByte()
throws ConversionException
- Description copied from interface:
IIntegerPM
- Returns the value of this PM as a
Byte
.
- Specified by:
getByte
in interface IIntegerPM
- Returns:
- the value of this PM as a Byte
- Throws:
ConversionException
- if the text value of this PM cannot be
converted to a Byte
setShort
public void setShort(java.lang.Short value)
- Description copied from interface:
IIntegerPM
- Sets the value of this PM to the given
Short
.
- Specified by:
setShort
in interface IIntegerPM
- Parameters:
value
- the Short value
getShort
public java.lang.Short getShort()
throws ConversionException
- Description copied from interface:
IIntegerPM
- Returns the value of this PM as a
Short
.
- Specified by:
getShort
in interface IIntegerPM
- Returns:
- the value of this PM as a Short
- Throws:
ConversionException
- if the text value of this PM cannot be
converted to a Short
setInteger
public void setInteger(java.lang.Integer value)
- Description copied from interface:
IIntegerPM
- Sets the value of this PM to the given
Integer
.
- Specified by:
setInteger
in interface IIntegerPM
- Parameters:
value
- the Integer value
getInteger
public java.lang.Integer getInteger()
throws ConversionException
- Description copied from interface:
IIntegerPM
- Returns the value of this PM as an
Integer
.
- Specified by:
getInteger
in interface IIntegerPM
- Returns:
- the value of this PM as an Integer
- Throws:
ConversionException
- if the text value of this PM cannot be
converted to an Integer
setLong
public void setLong(java.lang.Long value)
- Description copied from interface:
IIntegerPM
- Sets the value of this PM to the given
Long
.
- Specified by:
setLong
in interface IIntegerPM
- Parameters:
value
- the Long value
getLong
public java.lang.Long getLong()
throws ConversionException
- Description copied from interface:
IIntegerPM
- Returns the value of this PM as a
Long
.
- Specified by:
getLong
in interface IIntegerPM
- Returns:
- the value of this PM as a Long
- Throws:
ConversionException
- if the text value of this PM cannot be
converted to a Long