Package org.joda.time

Class MonthDay.Property

All Implemented Interfaces:
Serializable
Enclosing class:
MonthDay

public static class MonthDay.Property extends AbstractPartialFieldProperty implements Serializable
The property class for MonthDay.

This class binds a YearMonth to a DateTimeField.

Since:
2.0
Author:
Chris Pheby
See Also:
  • Method Details

    • getField

      public DateTimeField getField()
      Gets the field that this property uses.
      Specified by:
      getField in class AbstractPartialFieldProperty
      Returns:
      the field
    • getReadablePartial

      protected ReadablePartial getReadablePartial()
      Gets the partial that this property belongs to.
      Specified by:
      getReadablePartial in class AbstractPartialFieldProperty
      Returns:
      the partial
    • getMonthDay

      public MonthDay getMonthDay()
      Gets the partial that this property belongs to.
      Returns:
      the partial
    • get

      public int get()
      Gets the value of this field.
      Specified by:
      get in class AbstractPartialFieldProperty
      Returns:
      the field value
    • addToCopy

      public MonthDay addToCopy(int valueToAdd)
      Adds to the value of this field in a copy of this MonthDay.

      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.

      The MonthDay 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 MonthDay with the field value changed
      Throws:
      IllegalArgumentException - if the value isn't valid
    • addWrapFieldToCopy

      public MonthDay addWrapFieldToCopy(int valueToAdd)
      Adds to the value of this field in a copy of this MonthDay 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-30 addWrapField one month returns --01-30.

      The MonthDay 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 MonthDay with the field value changed
      Throws:
      IllegalArgumentException - if the value isn't valid
    • setCopy

      public MonthDay setCopy(int value)
      Sets this field in a copy of the MonthDay.

      The MonthDay 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 MonthDay with the field value changed
      Throws:
      IllegalArgumentException - if the value isn't valid
    • setCopy

      public MonthDay setCopy(String text, Locale locale)
      Sets this field in a copy of the MonthDay to a parsed text value.

      The MonthDay attached to this property is unchanged by this call. Instead, a new instance is returned.

      Parameters:
      text - the text value to set
      locale - optional locale to use for selecting a text symbol
      Returns:
      a copy of the MonthDay with the field value changed
      Throws:
      IllegalArgumentException - if the text value isn't valid
    • setCopy

      public MonthDay setCopy(String text)
      Sets this field in a copy of the MonthDay to a parsed text value.

      The MonthDay 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 MonthDay with the field value changed
      Throws:
      IllegalArgumentException - if the text value isn't valid