Class TimeOfDay.Property
- java.lang.Object
-
- org.joda.time.field.AbstractPartialFieldProperty
-
- org.joda.time.TimeOfDay.Property
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- TimeOfDay
@Deprecated public static class TimeOfDay.Property extends AbstractPartialFieldProperty implements java.io.Serializable
Deprecated.Use LocalTime which has a much better internal implementationThe property class forTimeOfDay
.This class binds a
TimeOfDay
to aDateTimeField
.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TimeOfDay
addNoWrapToCopy(int valueToAdd)
Deprecated.Adds to the value of this field in a copy of this TimeOfDay, throwing an Exception if the bounds are exceeded.TimeOfDay
addToCopy(int valueToAdd)
Deprecated.Adds to the value of this field in a copy of this TimeOfDay, wrapping to what would be the next day if necessary.TimeOfDay
addWrapFieldToCopy(int valueToAdd)
Deprecated.Adds to the value of this field in a copy of this TimeOfDay wrapping within this field if the maximum value is reached.int
get()
Deprecated.Gets the value of this field.DateTimeField
getField()
Deprecated.Gets the field that this property uses.TimeOfDay
getTimeOfDay()
Deprecated.Gets the partial that this property belongs to.TimeOfDay
setCopy(int value)
Deprecated.Sets this field in a copy of the TimeOfDay.TimeOfDay
setCopy(java.lang.String text)
Deprecated.Sets this field in a copy of the TimeOfDay to a parsed text value.TimeOfDay
setCopy(java.lang.String text, java.util.Locale locale)
Deprecated.Sets this field in a copy of the TimeOfDay to a parsed text value.TimeOfDay
withMaximumValue()
Deprecated.Returns a new TimeOfDay with this field set to the maximum value for this field.TimeOfDay
withMinimumValue()
Deprecated.Returns a new TimeOfDay with this field set to the minimum value for this field.-
Methods inherited from class org.joda.time.field.AbstractPartialFieldProperty
compareTo, compareTo, equals, getAsShortText, getAsShortText, getAsString, getAsText, getAsText, getDurationField, getFieldType, getMaximumShortTextLength, getMaximumTextLength, getMaximumValue, getMaximumValueOverall, getMinimumValue, getMinimumValueOverall, getName, getRangeDurationField, hashCode, toString
-
-
-
-
Method Detail
-
getField
public DateTimeField getField()
Deprecated.Gets the field that this property uses.- Specified by:
getField
in classAbstractPartialFieldProperty
- Returns:
- the field
-
getTimeOfDay
public TimeOfDay getTimeOfDay()
Deprecated.Gets the partial that this property belongs to.- Returns:
- the partial
-
get
public int get()
Deprecated.Gets the value of this field.- Specified by:
get
in classAbstractPartialFieldProperty
- Returns:
- the field value
-
addToCopy
public TimeOfDay addToCopy(int valueToAdd)
Deprecated.Adds to the value of this field in a copy of this TimeOfDay, wrapping to what would be the next day if necessary.The value will be added to this field. If the value is too large to be added solely to this field then it will affect larger fields. Smaller fields are unaffected.
If the result would be too large, beyond 23:59:59:999, then the calculation wraps to 00:00:00.000. For the alternate strict behaviour with no wrapping see
addNoWrapToCopy(int)
.The TimeOfDay attached to this property is unchanged by this call. Instead, a new instance is returned.
- Parameters:
valueToAdd
- the value to add to the field in the copy- Returns:
- a copy of the TimeOfDay with the field value changed
- Throws:
java.lang.IllegalArgumentException
- if the value isn't valid
-
addNoWrapToCopy
public TimeOfDay addNoWrapToCopy(int valueToAdd)
Deprecated.Adds to the value of this field in a copy of this TimeOfDay, throwing an Exception if the bounds are exceeded.The value will be added to this field. If the value is too large to be added solely to this field then it will affect larger fields. Smaller fields are unaffected.
If the result would be too large (beyond 23:59:59:999) or too small (less than 00:00:00.000) then an Exception is thrown. For the alternate behaviour which wraps to the next 'day', see
addToCopy(int)
.The TimeOfDay attached to this property is unchanged by this call. Instead, a new instance is returned.
- Parameters:
valueToAdd
- the value to add to the field in the copy- Returns:
- a copy of the TimeOfDay with the field value changed
- Throws:
java.lang.IllegalArgumentException
- if the value isn't valid
-
addWrapFieldToCopy
public TimeOfDay addWrapFieldToCopy(int valueToAdd)
Deprecated.Adds to the value of this field in a copy of this TimeOfDay wrapping within this field if the maximum value is reached.The value will be added to this field. If the value is too large to be added solely to this field then it wraps within this field. Other fields are unaffected.
For example,
12:59:37
addWrapField one minute returns12:00:37
.The TimeOfDay attached to this property is unchanged by this call. Instead, a new instance is returned.
- Parameters:
valueToAdd
- the value to add to the field in the copy- Returns:
- a copy of the TimeOfDay with the field value changed
- Throws:
java.lang.IllegalArgumentException
- if the value isn't valid
-
setCopy
public TimeOfDay setCopy(int value)
Deprecated.Sets this field in a copy of the TimeOfDay.The TimeOfDay attached to this property is unchanged by this call. Instead, a new instance is returned.
- Parameters:
value
- the value to set the field in the copy to- Returns:
- a copy of the TimeOfDay with the field value changed
- Throws:
java.lang.IllegalArgumentException
- if the value isn't valid
-
setCopy
public TimeOfDay setCopy(java.lang.String text, java.util.Locale locale)
Deprecated.Sets this field in a copy of the TimeOfDay to a parsed text value.The TimeOfDay attached to this property is unchanged by this call. Instead, a new instance is returned.
- Parameters:
text
- the text value to setlocale
- optional locale to use for selecting a text symbol- Returns:
- a copy of the TimeOfDay with the field value changed
- Throws:
java.lang.IllegalArgumentException
- if the text value isn't valid
-
setCopy
public TimeOfDay setCopy(java.lang.String text)
Deprecated.Sets this field in a copy of the TimeOfDay to a parsed text value.The TimeOfDay attached to this property is unchanged by this call. Instead, a new instance is returned.
- Parameters:
text
- the text value to set- Returns:
- a copy of the TimeOfDay with the field value changed
- Throws:
java.lang.IllegalArgumentException
- if the text value isn't valid
-
withMaximumValue
public TimeOfDay withMaximumValue()
Deprecated.Returns a new TimeOfDay with this field set to the maximum value for this field.The TimeOfDay attached to this property is unchanged by this call.
- Returns:
- a copy of the TimeOfDay with this field set to its maximum
- Since:
- 1.2
-
withMinimumValue
public TimeOfDay withMinimumValue()
Deprecated.Returns a new TimeOfDay with this field set to the minimum value for this field.The TimeOfDay attached to this property is unchanged by this call.
- Returns:
- a copy of the TimeOfDay with this field set to its minimum
- Since:
- 1.2
-
-