Package org.joda.time
Class IllegalFieldValueException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- org.joda.time.IllegalFieldValueException
-
- All Implemented Interfaces:
java.io.Serializable
public class IllegalFieldValueException extends java.lang.IllegalArgumentException
Exception thrown when attempting to set a field outside its supported range.- Since:
- 1.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IllegalFieldValueException(java.lang.String fieldName, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound)
Constructor.IllegalFieldValueException(java.lang.String fieldName, java.lang.String value)
Constructor.IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound)
Constructor.IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound, java.lang.String explain)
Constructor.IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.Number value, java.lang.String explain)
Constructor.IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.String value)
Constructor.IllegalFieldValueException(DurationFieldType fieldType, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound)
Constructor.IllegalFieldValueException(DurationFieldType fieldType, java.lang.String value)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeFieldType
getDateTimeFieldType()
Returns the DateTimeFieldType whose value was invalid, or null if not applicable.DurationFieldType
getDurationFieldType()
Returns the DurationFieldType whose value was invalid, or null if not applicable.java.lang.String
getFieldName()
Returns the name of the field whose value was invalid.java.lang.Number
getIllegalNumberValue()
Returns the illegal integer value assigned to the field, or null if not applicable.java.lang.String
getIllegalStringValue()
Returns the illegal string value assigned to the field, or null if not applicable.java.lang.String
getIllegalValueAsString()
Returns the illegal value assigned to the field as a non-null string.java.lang.Number
getLowerBound()
Returns the lower bound of the legal value range, or null if not applicable.java.lang.String
getMessage()
java.lang.Number
getUpperBound()
Returns the upper bound of the legal value range, or null if not applicable.void
prependMessage(java.lang.String message)
Provide additional detail by prepending a message to the existing message.
-
-
-
Constructor Detail
-
IllegalFieldValueException
public IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound)
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being setlowerBound
- lower legal field value, or null if not applicableupperBound
- upper legal field value, or null if not applicable
-
IllegalFieldValueException
public IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound, java.lang.String explain)
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being setlowerBound
- lower legal field value, or null if not applicableupperBound
- upper legal field value, or null if not applicableexplain
- an explanation message
-
IllegalFieldValueException
public IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.Number value, java.lang.String explain)
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being setexplain
- an explanation- Since:
- 1.5
-
IllegalFieldValueException
public IllegalFieldValueException(DurationFieldType fieldType, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound)
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being setlowerBound
- lower legal field value, or null if not applicableupperBound
- upper legal field value, or null if not applicable
-
IllegalFieldValueException
public IllegalFieldValueException(java.lang.String fieldName, java.lang.Number value, java.lang.Number lowerBound, java.lang.Number upperBound)
Constructor.- Parameters:
fieldName
- name of field being setvalue
- illegal value being setlowerBound
- lower legal field value, or null if not applicableupperBound
- upper legal field value, or null if not applicable
-
IllegalFieldValueException
public IllegalFieldValueException(DateTimeFieldType fieldType, java.lang.String value)
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being set
-
IllegalFieldValueException
public IllegalFieldValueException(DurationFieldType fieldType, java.lang.String value)
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being set
-
IllegalFieldValueException
public IllegalFieldValueException(java.lang.String fieldName, java.lang.String value)
Constructor.- Parameters:
fieldName
- name of field being setvalue
- illegal value being set
-
-
Method Detail
-
getDateTimeFieldType
public DateTimeFieldType getDateTimeFieldType()
Returns the DateTimeFieldType whose value was invalid, or null if not applicable.- Returns:
- the datetime field type
-
getDurationFieldType
public DurationFieldType getDurationFieldType()
Returns the DurationFieldType whose value was invalid, or null if not applicable.- Returns:
- the duration field type
-
getFieldName
public java.lang.String getFieldName()
Returns the name of the field whose value was invalid.- Returns:
- the field name
-
getIllegalNumberValue
public java.lang.Number getIllegalNumberValue()
Returns the illegal integer value assigned to the field, or null if not applicable.- Returns:
- the value
-
getIllegalStringValue
public java.lang.String getIllegalStringValue()
Returns the illegal string value assigned to the field, or null if not applicable.- Returns:
- the value
-
getIllegalValueAsString
public java.lang.String getIllegalValueAsString()
Returns the illegal value assigned to the field as a non-null string.- Returns:
- the value
-
getLowerBound
public java.lang.Number getLowerBound()
Returns the lower bound of the legal value range, or null if not applicable.- Returns:
- the lower bound
-
getUpperBound
public java.lang.Number getUpperBound()
Returns the upper bound of the legal value range, or null if not applicable.- Returns:
- the upper bound
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in classjava.lang.Throwable
-
prependMessage
public void prependMessage(java.lang.String message)
Provide additional detail by prepending a message to the existing message. A colon is separator is automatically inserted between the messages.- Since:
- 1.3
-
-