/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Returns a copy of this month-day with the value of the specified field increased. * <p> * If the addition is zero, then <code>this</code> is returned. * <p> * These three lines are equivalent: * <pre> * MonthDay added = md.withFieldAdded(DurationFieldType.days(), 6); * MonthDay added = md.plusDays(6); * MonthDay added = md.dayOfMonth().addToCopy(6); * </pre> * * @param fieldType the field type to add to, not null * @param amount the amount to add * @return a copy of this instance with the field updated, never null * @throws IllegalArgumentException if the value is null or invalid * @throws ArithmeticException if the new date-time exceeds the capacity */ public MonthDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).add(this, index, newValues, amount); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the value of the specified field increased. * <p> * If the addition is zero, then <code>this</code> is returned. * <p> * These three lines are equivalent: * <pre> * MonthDay added = md.withFieldAdded(DurationFieldType.days(), 6); * MonthDay added = md.plusDays(6); * MonthDay added = md.dayOfMonth().addToCopy(6); * </pre> * * @param fieldType the field type to add to, not null * @param amount the amount to add * @return a copy of this instance with the field updated, never null * @throws IllegalArgumentException if the value is null or invalid * @throws ArithmeticException if the new date-time exceeds the capacity */ public MonthDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).add(this, index, newValues, amount); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the specified field set to a new value. * <p> * For example, if the field type is <code>dayOfMonth</code> then the day * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * MonthDay updated = md.withField(DateTimeFieldType.dayOfMonth(), 6); * MonthDay updated = md.dayOfMonth().setCopy(6); * MonthDay updated = md.property(DateTimeFieldType.dayOfMonth()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public MonthDay withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the specified field set to a new value. * <p> * For example, if the field type is <code>dayOfMonth</code> then the day * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * MonthDay updated = md.withField(DateTimeFieldType.dayOfMonth(), 6); * MonthDay updated = md.dayOfMonth().setCopy(6); * MonthDay updated = md.property(DateTimeFieldType.dayOfMonth()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public MonthDay withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new MonthDay(this, newValues); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Returns a copy of this month-day with the value of the specified field increased. * <p> * If the addition is zero, then <code>this</code> is returned. * <p> * These three lines are equivalent: * <pre> * MonthDay added = md.withFieldAdded(DurationFieldType.days(), 6); * MonthDay added = md.plusDays(6); * MonthDay added = md.dayOfMonth().addToCopy(6); * </pre> * * @param fieldType the field type to add to, not null * @param amount the amount to add * @return a copy of this instance with the field updated, never null * @throws IllegalArgumentException if the value is null or invalid * @throws ArithmeticException if the new date-time exceeds the capacity */ public MonthDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).add(this, index, newValues, amount); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the specified field set to a new value. * <p> * For example, if the field type is <code>dayOfMonth</code> then the day * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * MonthDay updated = md.withField(DateTimeFieldType.dayOfMonth(), 6); * MonthDay updated = md.dayOfMonth().setCopy(6); * MonthDay updated = md.property(DateTimeFieldType.dayOfMonth()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public MonthDay withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new MonthDay(this, newValues); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Gets the property object for the specified type, which contains * many useful methods. * * @param type the field type to get the property for * @return the property object * @throws IllegalArgumentException if the field is null or unsupported */ public Property property(DateTimeFieldType type) { return new Property(this, indexOfSupported(type)); }
/** * Returns a copy of this month-day with the value of the specified field increased. * <p> * If the addition is zero, then <code>this</code> is returned. * <p> * These three lines are equivalent: * <pre> * MonthDay added = md.withFieldAdded(DurationFieldType.days(), 6); * MonthDay added = md.plusDays(6); * MonthDay added = md.dayOfMonth().addToCopy(6); * </pre> * * @param fieldType the field type to add to, not null * @param amount the amount to add * @return a copy of this instance with the field updated, never null * @throws IllegalArgumentException if the value is null or invalid * @throws ArithmeticException if the new date-time exceeds the capacity */ public MonthDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).add(this, index, newValues, amount); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the value of the specified field increased. * <p> * If the addition is zero, then <code>this</code> is returned. * <p> * These three lines are equivalent: * <pre> * MonthDay added = md.withFieldAdded(DurationFieldType.days(), 6); * MonthDay added = md.plusDays(6); * MonthDay added = md.dayOfMonth().addToCopy(6); * </pre> * * @param fieldType the field type to add to, not null * @param amount the amount to add * @return a copy of this instance with the field updated, never null * @throws IllegalArgumentException if the value is null or invalid * @throws ArithmeticException if the new date-time exceeds the capacity */ public MonthDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).add(this, index, newValues, amount); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the value of the specified field increased. * <p> * If the addition is zero, then <code>this</code> is returned. * <p> * These three lines are equivalent: * <pre> * MonthDay added = md.withFieldAdded(DurationFieldType.days(), 6); * MonthDay added = md.plusDays(6); * MonthDay added = md.dayOfMonth().addToCopy(6); * </pre> * * @param fieldType the field type to add to, not null * @param amount the amount to add * @return a copy of this instance with the field updated, never null * @throws IllegalArgumentException if the value is null or invalid * @throws ArithmeticException if the new date-time exceeds the capacity */ public MonthDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).add(this, index, newValues, amount); return new MonthDay(this, newValues); }
/** * Returns a copy of this month-day with the specified field set to a new value. * <p> * For example, if the field type is <code>dayOfMonth</code> then the day * would be changed in the returned instance. * <p> * These three lines are equivalent: * <pre> * MonthDay updated = md.withField(DateTimeFieldType.dayOfMonth(), 6); * MonthDay updated = md.dayOfMonth().setCopy(6); * MonthDay updated = md.property(DateTimeFieldType.dayOfMonth()).setCopy(6); * </pre> * * @param fieldType the field type to set, not null * @param value the value to set * @return a copy of this instance with the field set, never null * @throws IllegalArgumentException if the value is null or invalid */ public MonthDay withField(DateTimeFieldType fieldType, int value) { int index = indexOfSupported(fieldType); if (value == getValue(index)) { return this; } int[] newValues = getValues(); newValues = getField(index).set(this, index, newValues, value); return new MonthDay(this, newValues); }