/** * Sets the seconds field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setSeconds(Date date, int amount) { return set(date, Calendar.SECOND, amount); }
/** * Sets the minute field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMinutes(Date date, int amount) { return set(date, Calendar.MINUTE, amount); }
/** * Sets the years field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setYears(Date date, int amount) { return set(date, Calendar.YEAR, amount); }
/** * Sets the months field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMonths(Date date, int amount) { return set(date, Calendar.MONTH, amount); }
/** * Sets the hours field to a date returning a new object. Hours range * from 0-23. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setHours(Date date, int amount) { return set(date, Calendar.HOUR_OF_DAY, amount); }
/** * Sets the day of month field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setDays(Date date, int amount) { return set(date, Calendar.DAY_OF_MONTH, amount); }
/** * Sets the miliseconds field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMilliseconds(Date date, int amount) { return set(date, Calendar.MILLISECOND, amount); }
/** * Sets the miliseconds field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMilliseconds(Date date, int amount) { return set(date, Calendar.MILLISECOND, amount); }
/** * Sets the minute field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMinutes(Date date, int amount) { return set(date, Calendar.MINUTE, amount); }
/** * Sets the months field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMonths(Date date, int amount) { return set(date, Calendar.MONTH, amount); }
/** * Sets the miliseconds field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMilliseconds(Date date, int amount) { return set(date, Calendar.MILLISECOND, amount); }
/** * Sets the years field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setYears(Date date, int amount) { return set(date, Calendar.YEAR, amount); }
/** * Sets the day of month field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setDays(Date date, int amount) { return set(date, Calendar.DAY_OF_MONTH, amount); }
/** * Sets the years field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setYears(Date date, int amount) { return set(date, Calendar.YEAR, amount); }
/** * Sets the day of month field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setDays(Date date, int amount) { return set(date, Calendar.DAY_OF_MONTH, amount); }
/** * Sets the miliseconds field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMilliseconds(Date date, int amount) { return set(date, Calendar.MILLISECOND, amount); }
/** * Sets the years field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setYears(Date date, int amount) { return set(date, Calendar.YEAR, amount); }
/** * Sets the years field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setYears(Date date, int amount) { return set(date, Calendar.YEAR, amount); }
/** * Sets the months field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setMonths(Date date, int amount) { return set(date, Calendar.MONTH, amount); }
/** * Sets the years field to a date returning a new object. * The original date object is unchanged. * * @param date the date, not null * @param amount the amount to set * @return a new Date object set with the specified value * @throws IllegalArgumentException if the date is null * @since 2.4 */ public static Date setYears(Date date, int amount) { return set(date, Calendar.YEAR, amount); }