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:
Serializable
Exception thrown when attempting to set a field outside its supported range.
- Since:
- 1.1
- Author:
- Brian S O'Neill
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionIllegalFieldValueException
(String fieldName, Number value, Number lowerBound, Number upperBound) Constructor.IllegalFieldValueException
(String fieldName, String value) Constructor.IllegalFieldValueException
(DateTimeFieldType fieldType, Number value, Number lowerBound, Number upperBound) Constructor.IllegalFieldValueException
(DateTimeFieldType fieldType, Number value, Number lowerBound, Number upperBound, String explain) Constructor.IllegalFieldValueException
(DateTimeFieldType fieldType, Number value, String explain) Constructor.IllegalFieldValueException
(DateTimeFieldType fieldType, String value) Constructor.IllegalFieldValueException
(DurationFieldType fieldType, Number value, Number lowerBound, Number upperBound) Constructor.IllegalFieldValueException
(DurationFieldType fieldType, String value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the DateTimeFieldType whose value was invalid, or null if not applicable.Returns the DurationFieldType whose value was invalid, or null if not applicable.Returns the name of the field whose value was invalid.Returns the illegal integer value assigned to the field, or null if not applicable.Returns the illegal string value assigned to the field, or null if not applicable.Returns the illegal value assigned to the field as a non-null string.Returns the lower bound of the legal value range, or null if not applicable.Returns the upper bound of the legal value range, or null if not applicable.void
prependMessage
(String message) Provide additional detail by prepending a message to the existing message.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IllegalFieldValueException
public IllegalFieldValueException(DateTimeFieldType fieldType, Number value, Number lowerBound, 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, Number value, Number lowerBound, Number upperBound, 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
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being setexplain
- an explanation- Since:
- 1.5
-
IllegalFieldValueException
public IllegalFieldValueException(DurationFieldType fieldType, Number value, Number lowerBound, 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(String fieldName, Number value, Number lowerBound, 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
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being set
-
IllegalFieldValueException
Constructor.- Parameters:
fieldType
- type of field being setvalue
- illegal value being set
-
IllegalFieldValueException
Constructor.- Parameters:
fieldName
- name of field being setvalue
- illegal value being set
-
-
Method Details
-
getDateTimeFieldType
Returns the DateTimeFieldType whose value was invalid, or null if not applicable.- Returns:
- the datetime field type
-
getDurationFieldType
Returns the DurationFieldType whose value was invalid, or null if not applicable.- Returns:
- the duration field type
-
getFieldName
Returns the name of the field whose value was invalid.- Returns:
- the field name
-
getIllegalNumberValue
Returns the illegal integer value assigned to the field, or null if not applicable.- Returns:
- the value
-
getIllegalStringValue
Returns the illegal string value assigned to the field, or null if not applicable.- Returns:
- the value
-
getIllegalValueAsString
Returns the illegal value assigned to the field as a non-null string.- Returns:
- the value
-
getLowerBound
Returns the lower bound of the legal value range, or null if not applicable.- Returns:
- the lower bound
-
getUpperBound
Returns the upper bound of the legal value range, or null if not applicable.- Returns:
- the upper bound
-
getMessage
- Overrides:
getMessage
in classThrowable
-
prependMessage
Provide additional detail by prepending a message to the existing message. A colon is separator is automatically inserted between the messages.- Parameters:
message
- the message to prepend- Since:
- 1.3
-