diff options
author | Gary Gregory <garydgregory@gmail.com> | 2022-06-19 09:30:36 -0400 |
---|---|---|
committer | Gary Gregory <garydgregory@gmail.com> | 2022-06-19 09:30:36 -0400 |
commit | 2e71945163b08326a64b7264466069dd3a83b0de (patch) | |
tree | d9d8500b23e06b3be6718d0cad67c412cbc956c4 /src/main/java/org/apache/commons/lang3/time | |
parent | 911fbb9352f029dd02971eebdbf7d9cffc7f9175 (diff) | |
download | apache-commons-lang-2e71945163b08326a64b7264466069dd3a83b0de.tar.gz |
Replace @code with @link for class references
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/time')
10 files changed, 150 insertions, 144 deletions
diff --git a/src/main/java/org/apache/commons/lang3/time/DateParser.java b/src/main/java/org/apache/commons/lang3/time/DateParser.java index ee52f57bf..df90a8977 100644 --- a/src/main/java/org/apache/commons/lang3/time/DateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/DateParser.java @@ -39,8 +39,8 @@ public interface DateParser { * Equivalent to DateFormat.parse(String). * * See {@link java.text.DateFormat#parse(String)} for more information. - * @param source A {@code String} whose beginning should be parsed. - * @return A {@code Date} parsed from the string + * @param source A {@link String} whose beginning should be parsed. + * @return A {@link Date} parsed from the string * @throws ParseException if the beginning of the specified string cannot be parsed. */ Date parse(String source) throws ParseException; @@ -50,10 +50,10 @@ public interface DateParser { * * See {@link java.text.DateFormat#parse(String, ParsePosition)} for more information. * - * @param source A {@code String}, part of which should be parsed. - * @param pos A {@code ParsePosition} object with index and error index information + * @param source A {@link String}, part of which should be parsed. + * @param pos A {@link ParsePosition} object with index and error index information * as described above. - * @return A {@code Date} parsed from the string. In case of error, returns null. + * @return A {@link Date} parsed from the string. In case of error, returns null. * @throws NullPointerException if text or pos is null. */ Date parse(String source, ParsePosition pos); @@ -107,7 +107,7 @@ public interface DateParser { /** * Parses text from a string to produce a Date. * - * @param source A {@code String} whose beginning should be parsed. + * @param source A {@link String} whose beginning should be parsed. * @return a {@code java.util.Date} object * @throws ParseException if the beginning of the specified string cannot be parsed. * @see java.text.DateFormat#parseObject(String) @@ -117,7 +117,7 @@ public interface DateParser { /** * Parses a date/time string according to the given parse position. * - * @param source A {@code String} whose beginning should be parsed. + * @param source A {@link String} whose beginning should be parsed. * @param pos the parse position * @return a {@code java.util.Date} object * @see java.text.DateFormat#parseObject(String, ParsePosition) diff --git a/src/main/java/org/apache/commons/lang3/time/DatePrinter.java b/src/main/java/org/apache/commons/lang3/time/DatePrinter.java index c9955f89f..37c781653 100644 --- a/src/main/java/org/apache/commons/lang3/time/DatePrinter.java +++ b/src/main/java/org/apache/commons/lang3/time/DatePrinter.java @@ -19,6 +19,7 @@ package org.apache.commons.lang3.time; import java.text.FieldPosition; import java.util.Calendar; import java.util.Date; +import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; @@ -44,7 +45,7 @@ public interface DatePrinter { String format(long millis); /** - * <p>Formats a {@code Date} object using a {@code GregorianCalendar}.</p> + * <p>Formats a {@link Date} object using a {@link GregorianCalendar}.</p> * * @param date the date to format * @return the formatted string @@ -52,7 +53,7 @@ public interface DatePrinter { String format(Date date); /** - * <p>Formats a {@code Calendar} object.</p> + * <p>Formats a {@link Calendar} object.</p> * The TimeZone set on the Calendar is only used to adjust the time offset. * The TimeZone specified during the construction of the Parser will determine the TimeZone * used in the formatted string. @@ -64,7 +65,7 @@ public interface DatePrinter { /** * <p>Formats a millisecond {@code long} value into the - * supplied {@code StringBuffer}.</p> + * supplied {@link StringBuffer}.</p> * * @param millis the millisecond value to format * @param buf the buffer to format into @@ -75,8 +76,8 @@ public interface DatePrinter { StringBuffer format(long millis, StringBuffer buf); /** - * <p>Formats a {@code Date} object into the - * supplied {@code StringBuffer} using a {@code GregorianCalendar}.</p> + * <p>Formats a {@link Date} object into the + * supplied {@link StringBuffer} using a {@link GregorianCalendar}.</p> * * @param date the date to format * @param buf the buffer to format into @@ -87,7 +88,7 @@ public interface DatePrinter { StringBuffer format(Date date, StringBuffer buf); /** - * <p>Formats a {@code Calendar} object into the supplied {@code StringBuffer}.</p> + * <p>Formats a {@link Calendar} object into the supplied {@link StringBuffer}.</p> * The TimeZone set on the Calendar is only used to adjust the time offset. * The TimeZone specified during the construction of the Parser will determine the TimeZone * used in the formatted string. @@ -102,7 +103,7 @@ public interface DatePrinter { /** * <p>Formats a millisecond {@code long} value into the - * supplied {@code Appendable}.</p> + * supplied {@link Appendable}.</p> * * @param millis the millisecond value to format * @param buf the buffer to format into @@ -113,8 +114,8 @@ public interface DatePrinter { <B extends Appendable> B format(long millis, B buf); /** - * <p>Formats a {@code Date} object into the - * supplied {@code Appendable} using a {@code GregorianCalendar}.</p> + * <p>Formats a {@link Date} object into the + * supplied {@link Appendable} using a {@link GregorianCalendar}.</p> * * @param date the date to format * @param buf the buffer to format into @@ -125,7 +126,7 @@ public interface DatePrinter { <B extends Appendable> B format(Date date, B buf); /** - * <p>Formats a {@code Calendar} object into the supplied {@code Appendable}.</p> + * <p>Formats a {@link Calendar} object into the supplied {@link Appendable}.</p> * The TimeZone set on the Calendar is only used to adjust the time offset. * The TimeZone specified during the construction of the Parser will determine the TimeZone * used in the formatted string. @@ -150,7 +151,7 @@ public interface DatePrinter { /** * <p>Gets the time zone used by this printer.</p> * - * <p>This zone is always used for {@code Date} printing. </p> + * <p>This zone is always used for {@link Date} printing. </p> * * @return the time zone */ @@ -164,8 +165,8 @@ public interface DatePrinter { Locale getLocale(); /** - * <p>Formats a {@code Date}, {@code Calendar} or - * {@code Long} (milliseconds) object.</p> + * <p>Formats a {@link Date}, {@link Calendar} or + * {@link Long} (milliseconds) object.</p> * * @param obj the object to format * @param toAppendTo the buffer to append to diff --git a/src/main/java/org/apache/commons/lang3/time/DateUtils.java b/src/main/java/org/apache/commons/lang3/time/DateUtils.java index 78fb6b964..6710511b8 100644 --- a/src/main/java/org/apache/commons/lang3/time/DateUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DateUtils.java @@ -44,9 +44,9 @@ import org.apache.commons.lang3.Validate; * kind of date-field you want your result, for instance milliseconds or days. * </p> * <p> - * Several methods are provided for adding to {@code Date} objects, of the form + * Several methods are provided for adding to {@link Date} objects, of the form * {@code addXXX(Date date, int amount)}. It is important to note these methods - * use a {@code Calendar} internally (with default time zone and locale) and may + * use a {@link Calendar} internally (with default time zone and locale) and may * be affected by changes to daylight saving time (DST). * </p> * @@ -139,7 +139,7 @@ public class DateUtils { } /** - * <p>{@code DateUtils} instances should NOT be constructed in + * <p>{@link DateUtils} instances should NOT be constructed in * standard programming. Instead, the static methods on the class should * be used, such as {@code DateUtils.parseDate(str);}.</p> * @@ -384,11 +384,11 @@ public class DateUtils { /** * Adds a number of years to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addYears(final Date date, final int amount) { @@ -397,11 +397,11 @@ public class DateUtils { /** * Adds a number of months to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addMonths(final Date date, final int amount) { @@ -410,11 +410,11 @@ public class DateUtils { /** * Adds a number of weeks to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addWeeks(final Date date, final int amount) { @@ -423,11 +423,11 @@ public class DateUtils { /** * Adds a number of days to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addDays(final Date date, final int amount) { @@ -436,11 +436,11 @@ public class DateUtils { /** * Adds a number of hours to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addHours(final Date date, final int amount) { @@ -449,11 +449,11 @@ public class DateUtils { /** * Adds a number of minutes to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addMinutes(final Date date, final int amount) { @@ -462,11 +462,11 @@ public class DateUtils { /** * Adds a number of seconds to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addSeconds(final Date date, final int amount) { @@ -475,11 +475,11 @@ public class DateUtils { /** * Adds a number of milliseconds to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ public static Date addMilliseconds(final Date date, final int amount) { @@ -488,12 +488,12 @@ public class DateUtils { /** * Adds to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param calendarField the calendar field to add to * @param amount the amount to add, may be negative - * @return the new {@code Date} with the amount added + * @return the new {@link Date} with the amount added * @throws NullPointerException if the date is null */ private static Date add(final Date date, final int calendarField, final int amount) { @@ -506,11 +506,11 @@ public class DateUtils { /** * Sets the years field to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @since 2.4 */ @@ -520,11 +520,11 @@ public class DateUtils { /** * Sets the months field to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @throws IllegalArgumentException if {@code amount} is not in the range * {@code 0 <= amount <= 11} @@ -536,11 +536,11 @@ public class DateUtils { /** * Sets the day of month field to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @throws IllegalArgumentException if {@code amount} is not in the range * {@code 1 <= amount <= 31} @@ -553,11 +553,11 @@ public class DateUtils { /** * Sets the hours field to a date returning a new object. Hours range * from 0-23. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @throws IllegalArgumentException if {@code amount} is not in the range * {@code 0 <= amount <= 23} @@ -569,11 +569,11 @@ public class DateUtils { /** * Sets the minute field to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @throws IllegalArgumentException if {@code amount} is not in the range * {@code 0 <= amount <= 59} @@ -585,11 +585,11 @@ public class DateUtils { /** * Sets the seconds field to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @throws IllegalArgumentException if {@code amount} is not in the range * {@code 0 <= amount <= 59} @@ -601,11 +601,11 @@ public class DateUtils { /** * Sets the milliseconds field to a date returning a new object. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @throws IllegalArgumentException if {@code amount} is not in the range * {@code 0 <= amount <= 999} @@ -618,12 +618,12 @@ public class DateUtils { /** * Sets the specified field to a date returning a new object. * This does not use a lenient calendar. - * The original {@code Date} is unchanged. + * The original {@link Date} is unchanged. * * @param date the date, not null - * @param calendarField the {@code Calendar} field to set the amount to + * @param calendarField the {@link Calendar} field to set the amount to * @param amount the amount to set - * @return a new {@code Date} set with the specified value + * @return a new {@link Date} set with the specified value * @throws NullPointerException if the date is null * @since 2.4 */ @@ -638,7 +638,7 @@ public class DateUtils { } /** - * Converts a {@code Date} into a {@code Calendar}. + * Converts a {@link Date} into a {@link Calendar}. * * @param date the date to convert to a Calendar * @return the created Calendar @@ -652,7 +652,7 @@ public class DateUtils { } /** - * Converts a {@code Date} of a given {@code TimeZone} into a {@code Calendar} + * Converts a {@link Date} of a given {@link TimeZone} into a {@link Calendar} * @param date the date to convert to a Calendar * @param tz the time zone of the {@code date} * @return the created Calendar @@ -686,7 +686,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different rounded date, not null * @throws NullPointerException if the date is null * @throws ArithmeticException if the year is over 280 million @@ -721,7 +721,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different rounded date, not null * @throws IllegalArgumentException if the date is {@code null} * @throws ArithmeticException if the year is over 280 million @@ -760,11 +760,11 @@ public class DateUtils { * <li>March 30, 2003 02:40 rounds to March 30, 2003 04:00</li> * </ul> * - * @param date the date to work with, either {@code Date} or {@code Calendar}, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param date the date to work with, either {@link Date} or {@link Calendar}, not null + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different rounded date, not null * @throws IllegalArgumentException if the date is {@code null} - * @throws ClassCastException if the object type is not a {@code Date} or {@code Calendar} + * @throws ClassCastException if the object type is not a {@link Date} or {@link Calendar} * @throws ArithmeticException if the year is over 280 million */ public static Date round(final Object date, final int field) { @@ -790,7 +790,7 @@ public class DateUtils { * return 1 Mar 2002 0:00:00.000.</p> * * @param date the date to work with, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different truncated date, not null * @throws NullPointerException if the date is {@code null} * @throws ArithmeticException if the year is over 280 million @@ -813,7 +813,7 @@ public class DateUtils { * return 1 Mar 2002 0:00:00.000.</p> * * @param date the date to work with, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different truncated date, not null * @throws IllegalArgumentException if the date is {@code null} * @throws ArithmeticException if the year is over 280 million @@ -836,11 +836,11 @@ public class DateUtils { * 2002 13:00:00.000. If this was passed with MONTH, it would * return 1 Mar 2002 0:00:00.000.</p> * - * @param date the date to work with, either {@code Date} or {@code Calendar}, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param date the date to work with, either {@link Date} or {@link Calendar}, not null + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different truncated date, not null * @throws IllegalArgumentException if the date is {@code null} - * @throws ClassCastException if the object type is not a {@code Date} or {@code Calendar} + * @throws ClassCastException if the object type is not a {@link Date} or {@link Calendar} * @throws ArithmeticException if the year is over 280 million */ public static Date truncate(final Object date, final int field) { @@ -866,7 +866,7 @@ public class DateUtils { * return 1 Apr 2002 0:00:00.000.</p> * * @param date the date to work with, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different ceil date, not null * @throws NullPointerException if the date is {@code null} * @throws ArithmeticException if the year is over 280 million @@ -890,7 +890,7 @@ public class DateUtils { * return 1 Apr 2002 0:00:00.000.</p> * * @param date the date to work with, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different ceil date, not null * @throws IllegalArgumentException if the date is {@code null} * @throws ArithmeticException if the year is over 280 million @@ -914,11 +914,11 @@ public class DateUtils { * 2002 14:00:00.000. If this was passed with MONTH, it would * return 1 Apr 2002 0:00:00.000.</p> * - * @param date the date to work with, either {@code Date} or {@code Calendar}, not null - * @param field the field from {@code Calendar} or {@code SEMI_MONTH} + * @param date the date to work with, either {@link Date} or {@link Calendar}, not null + * @param field the field from {@link Calendar} or {@code SEMI_MONTH} * @return the different ceil date, not null * @throws IllegalArgumentException if the date is {@code null} - * @throws ClassCastException if the object type is not a {@code Date} or {@code Calendar} + * @throws ClassCastException if the object type is not a {@link Date} or {@link Calendar} * @throws ArithmeticException if the year is over 280 million * @since 2.5 */ @@ -1084,11 +1084,11 @@ public class DateUtils { } /** - * <p>Constructs an {@code Iterator} over each day in a date + * <p>Constructs an {@link Iterator} over each day in a date * range defined by a focus date and range style.</p> * * <p>For instance, passing Thursday, July 4, 2002 and a - * {@code RANGE_MONTH_SUNDAY} will return an {@code Iterator} + * {@code RANGE_MONTH_SUNDAY} will return an {@link Iterator} * that starts with Sunday, June 30, 2002 and ends with Saturday, August 3, * 2002, returning a Calendar instance for each intermediate day.</p> * @@ -1115,11 +1115,11 @@ public class DateUtils { } /** - * <p>Constructs an {@code Iterator} over each day in a date + * <p>Constructs an {@link Iterator} over each day in a date * range defined by a focus date and range style.</p> * * <p>For instance, passing Thursday, July 4, 2002 and a - * {@code RANGE_MONTH_SUNDAY} will return an {@code Iterator} + * {@code RANGE_MONTH_SUNDAY} will return an {@link Iterator} * that starts with Sunday, June 30, 2002 and ends with Saturday, August 3, * 2002, returning a Calendar instance for each intermediate day.</p> * @@ -1213,20 +1213,20 @@ public class DateUtils { } /** - * <p>Constructs an {@code Iterator} over each day in a date + * <p>Constructs an {@link Iterator} over each day in a date * range defined by a focus date and range style.</p> * * <p>For instance, passing Thursday, July 4, 2002 and a - * {@code RANGE_MONTH_SUNDAY} will return an {@code Iterator} + * {@code RANGE_MONTH_SUNDAY} will return an {@link Iterator} * that starts with Sunday, June 30, 2002 and ends with Saturday, August 3, * 2002, returning a Calendar instance for each intermediate day.</p> * - * @param focus the date to work with, either {@code Date} or {@code Calendar}, not null + * @param focus the date to work with, either {@link Date} or {@link Calendar}, not null * @param rangeStyle the style constant to use. Must be one of the range * styles listed for the {@link #iterator(Calendar, int)} method. * @return the date iterator, not null * @throws IllegalArgumentException if the date is {@code null} - * @throws ClassCastException if the object type is not a {@code Date} or {@code Calendar} + * @throws ClassCastException if the object type is not a {@link Date} or {@link Calendar} */ public static Iterator<?> iterator(final Object focus, final int rangeStyle) { if (focus == null) { @@ -1266,7 +1266,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param fragment the {@code Calendar} field part of date to calculate + * @param fragment the {@link Calendar} field part of date to calculate * @return number of milliseconds within the fragment of date * @throws NullPointerException if the date is {@code null} * @throws IllegalArgumentException if the fragment is not supported @@ -1304,7 +1304,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param fragment the {@code Calendar} field part of date to calculate + * @param fragment the {@link Calendar} field part of date to calculate * @return number of seconds within the fragment of date * @throws NullPointerException if the date is {@code null} * @throws IllegalArgumentException if the fragment is not supported @@ -1342,7 +1342,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param fragment the {@code Calendar} field part of date to calculate + * @param fragment the {@link Calendar} field part of date to calculate * @return number of minutes within the fragment of date * @throws NullPointerException if the date is {@code null} * @throws IllegalArgumentException if the fragment is not supported @@ -1380,7 +1380,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param fragment the {@code Calendar} field part of date to calculate + * @param fragment the {@link Calendar} field part of date to calculate * @return number of hours within the fragment of date * @throws NullPointerException if the date is {@code null} * @throws IllegalArgumentException if the fragment is not supported @@ -1418,7 +1418,7 @@ public class DateUtils { * </ul> * * @param date the date to work with, not null - * @param fragment the {@code Calendar} field part of date to calculate + * @param fragment the {@link Calendar} field part of date to calculate * @return number of days within the fragment of date * @throws NullPointerException if the date is {@code null} * @throws IllegalArgumentException if the fragment is not supported @@ -1456,7 +1456,7 @@ public class DateUtils { * </ul> * * @param calendar the calendar to work with, not null - * @param fragment the {@code Calendar} field part of calendar to calculate + * @param fragment the {@link Calendar} field part of calendar to calculate * @return number of milliseconds within the fragment of date * @throws IllegalArgumentException if the date is {@code null} or * fragment is not supported @@ -1493,7 +1493,7 @@ public class DateUtils { * </ul> * * @param calendar the calendar to work with, not null - * @param fragment the {@code Calendar} field part of calendar to calculate + * @param fragment the {@link Calendar} field part of calendar to calculate * @return number of seconds within the fragment of date * @throws IllegalArgumentException if the date is {@code null} or * fragment is not supported @@ -1531,7 +1531,7 @@ public class DateUtils { * </ul> * * @param calendar the calendar to work with, not null - * @param fragment the {@code Calendar} field part of calendar to calculate + * @param fragment the {@link Calendar} field part of calendar to calculate * @return number of minutes within the fragment of date * @throws IllegalArgumentException if the date is {@code null} or * fragment is not supported @@ -1569,7 +1569,7 @@ public class DateUtils { * </ul> * * @param calendar the calendar to work with, not null - * @param fragment the {@code Calendar} field part of calendar to calculate + * @param fragment the {@link Calendar} field part of calendar to calculate * @return number of hours within the fragment of date * @throws IllegalArgumentException if the date is {@code null} or * fragment is not supported @@ -1609,7 +1609,7 @@ public class DateUtils { * </ul> * * @param calendar the calendar to work with, not null - * @param fragment the {@code Calendar} field part of calendar to calculate + * @param fragment the {@link Calendar} field part of calendar to calculate * @return number of days within the fragment of date * @throws IllegalArgumentException if the date is {@code null} or * fragment is not supported @@ -1700,7 +1700,7 @@ public class DateUtils { * * @param cal1 the first calendar, not {@code null} * @param cal2 the second calendar, not {@code null} - * @param field the field from {@code Calendar} + * @param field the field from {@link Calendar} * @return {@code true} if equal; otherwise {@code false} * @throws IllegalArgumentException if any argument is {@code null} * @see #truncate(Calendar, int) @@ -1717,7 +1717,7 @@ public class DateUtils { * * @param date1 the first date, not {@code null} * @param date2 the second date, not {@code null} - * @param field the field from {@code Calendar} + * @param field the field from {@link Calendar} * @return {@code true} if equal; otherwise {@code false} * @throws NullPointerException if any argument is {@code null} * @see #truncate(Date, int) @@ -1734,7 +1734,7 @@ public class DateUtils { * * @param cal1 the first calendar, not {@code null} * @param cal2 the second calendar, not {@code null} - * @param field the field from {@code Calendar} + * @param field the field from {@link Calendar} * @return a negative integer, zero, or a positive integer as the first * calendar is less than, equal to, or greater than the second. * @throws IllegalArgumentException if any argument is {@code null} @@ -1754,7 +1754,7 @@ public class DateUtils { * * @param date1 the first date, not {@code null} * @param date2 the second date, not {@code null} - * @param field the field from {@code Calendar} + * @param field the field from {@link Calendar} * @return a negative integer, zero, or a positive integer as the first * date is less than, equal to, or greater than the second. * @throws NullPointerException if any argument is {@code null} diff --git a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java index 11b565b01..43f6b6788 100644 --- a/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java @@ -16,6 +16,7 @@ */ package org.apache.commons.lang3.time; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; @@ -60,7 +61,7 @@ public class DurationFormatUtils { } /** - * <p>Pattern used with {@code FastDateFormat} and {@code SimpleDateFormat} + * <p>Pattern used with {@link FastDateFormat} and {@link SimpleDateFormat} * for the ISO 8601 period format used in durations.</p> * * @see org.apache.commons.lang3.time.FastDateFormat @@ -461,7 +462,7 @@ public class DurationFormatUtils { } /** - * <p>Converts a {@code long} to a {@code String} with optional + * <p>Converts a {@code long} to a {@link String} with optional * zero padding.</p> * * @param value the value to convert diff --git a/src/main/java/org/apache/commons/lang3/time/DurationUtils.java b/src/main/java/org/apache/commons/lang3/time/DurationUtils.java index d349a7473..cd16301ec 100644 --- a/src/main/java/org/apache/commons/lang3/time/DurationUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DurationUtils.java @@ -123,7 +123,7 @@ public class DurationUtils { * Computes the Duration between a start instant and now. * * @param startInclusive the start instant, inclusive, not null. - * @return a {@code Duration}, not null. + * @return a {@link Duration}, not null. */ public static Duration since(final Temporal startInclusive) { return Duration.between(startInclusive, Instant.now()); diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java b/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java index 893b477dc..497bb7c42 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java @@ -21,8 +21,10 @@ import java.text.FieldPosition; import java.text.Format; import java.text.ParseException; import java.text.ParsePosition; +import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import java.util.GregorianCalendar; import java.util.Locale; import java.util.TimeZone; @@ -41,9 +43,9 @@ import java.util.TimeZone; * </code> * * <p>This class can be used as a direct replacement to - * {@code SimpleDateFormat} in most formatting and parsing situations. + * {@link SimpleDateFormat} in most formatting and parsing situations. * This class is especially useful in multi-threaded server environments. - * {@code SimpleDateFormat} is not thread-safe in any JDK version, + * {@link SimpleDateFormat} is not thread-safe in any JDK version, * nor will it be as Sun have closed the bug/RFE. * </p> * @@ -398,8 +400,8 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { // Format methods /** - * <p>Formats a {@code Date}, {@code Calendar} or - * {@code Long} (milliseconds) object.</p> + * <p>Formats a {@link Date}, {@link Calendar} or + * {@link Long} (milliseconds) object.</p> * This method is an implementation of {@link Format#format(Object, StringBuffer, FieldPosition)} * * @param obj the object to format @@ -425,7 +427,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { } /** - * <p>Formats a {@code Date} object using a {@code GregorianCalendar}.</p> + * <p>Formats a {@link Date} object using a {@link GregorianCalendar}.</p> * * @param date the date to format * @return the formatted string @@ -436,7 +438,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { } /** - * <p>Formats a {@code Calendar} object.</p> + * <p>Formats a {@link Calendar} object.</p> * * @param calendar the calendar to format * @return the formatted string @@ -448,7 +450,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { /** * <p>Formats a millisecond {@code long} value into the - * supplied {@code StringBuffer}.</p> + * supplied {@link StringBuffer}.</p> * * @param millis the millisecond value to format * @param buf the buffer to format into @@ -463,8 +465,8 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { } /** - * <p>Formats a {@code Date} object into the - * supplied {@code StringBuffer} using a {@code GregorianCalendar}.</p> + * <p>Formats a {@link Date} object into the + * supplied {@link StringBuffer} using a {@link GregorianCalendar}.</p> * * @param date the date to format * @param buf the buffer to format into @@ -478,8 +480,8 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { } /** - * <p>Formats a {@code Calendar} object into the - * supplied {@code StringBuffer}.</p> + * <p>Formats a {@link Calendar} object into the + * supplied {@link StringBuffer}.</p> * * @param calendar the calendar to format * @param buf the buffer to format into @@ -494,7 +496,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { /** * <p>Formats a millisecond {@code long} value into the - * supplied {@code StringBuffer}.</p> + * supplied {@link StringBuffer}.</p> * * @param millis the millisecond value to format * @param buf the buffer to format into @@ -507,8 +509,8 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { } /** - * <p>Formats a {@code Date} object into the - * supplied {@code StringBuffer} using a {@code GregorianCalendar}.</p> + * <p>Formats a {@link Date} object into the + * supplied {@link StringBuffer} using a {@link GregorianCalendar}.</p> * * @param date the date to format * @param buf the buffer to format into @@ -521,8 +523,8 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { } /** - * <p>Formats a {@code Calendar} object into the - * supplied {@code StringBuffer}.</p> + * <p>Formats a {@link Calendar} object into the + * supplied {@link StringBuffer}.</p> * * @param calendar the calendar to format * @param buf the buffer to format into @@ -584,7 +586,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter { /** * <p>Gets the time zone used by this formatter.</p> * - * <p>This zone is always used for {@code Date} formatting. </p> + * <p>This zone is always used for {@link Date} formatting. </p> * * @return the time zone */ diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java index 98b48d261..7539b2793 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java @@ -22,6 +22,7 @@ import java.io.Serializable; import java.text.DateFormatSymbols; import java.text.ParseException; import java.text.ParsePosition; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Comparator; @@ -54,9 +55,9 @@ import org.apache.commons.lang3.LocaleUtils; * </code> * * <p>This class can be used as a direct replacement for - * {@code SimpleDateFormat} in most parsing situations. + * {@link SimpleDateFormat} in most parsing situations. * This class is especially useful in multi-threaded server environments. - * {@code SimpleDateFormat} is not thread-safe in any JDK version, + * {@link SimpleDateFormat} is not thread-safe in any JDK version, * nor will it be as Sun has closed the * <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4228335">bug</a>/RFE. * </p> diff --git a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java index 7c006b1fb..229f4739c 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java @@ -22,6 +22,7 @@ import java.io.Serializable; import java.text.DateFormat; import java.text.DateFormatSymbols; import java.text.FieldPosition; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; @@ -47,9 +48,9 @@ import org.apache.commons.lang3.exception.ExceptionUtils; * </code> * * <p>This class can be used as a direct replacement to - * {@code SimpleDateFormat} in most formatting situations. + * {@link SimpleDateFormat} in most formatting situations. * This class is especially useful in multi-threaded server environments. - * {@code SimpleDateFormat} is not thread-safe in any JDK version, + * {@link SimpleDateFormat} is not thread-safe in any JDK version, * nor will it be as Sun have closed the bug/RFE. * </p> * @@ -176,7 +177,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { /** * <p>Returns a list of Rules given a pattern.</p> * - * @return a {@code List} of Rule objects + * @return a {@link List} of Rule objects * @throws IllegalArgumentException if pattern is invalid */ protected List<Rule> parsePattern() { @@ -403,8 +404,8 @@ public class FastDatePrinter implements DatePrinter, Serializable { // Format methods /** - * <p>Formats a {@code Date}, {@code Calendar} or - * {@code Long} (milliseconds) object.</p> + * <p>Formats a {@link Date}, {@link Calendar} or + * {@link Long} (milliseconds) object.</p> * @deprecated Use {{@link #format(Date)}, {{@link #format(Calendar)}, {{@link #format(long)}. * @param obj the object to format * @param toAppendTo the buffer to append to @@ -428,8 +429,8 @@ public class FastDatePrinter implements DatePrinter, Serializable { } /** - * <p>Formats a {@code Date}, {@code Calendar} or - * {@code Long} (milliseconds) object.</p> + * <p>Formats a {@link Date}, {@link Calendar} or + * {@link Long} (milliseconds) object.</p> * @since 3.5 * @param obj the object to format * @return The formatted value. @@ -811,7 +812,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final char mValue; /** - * Constructs a new instance of {@code CharacterLiteral} + * Constructs a new instance of {@link CharacterLiteral} * to hold the specified value. * * @param value the character literal @@ -844,7 +845,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final String mValue; /** - * Constructs a new instance of {@code StringLiteral} + * Constructs a new instance of {@link StringLiteral} * to hold the specified value. * * @param value the string literal @@ -878,7 +879,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final String[] mValues; /** - * Constructs an instance of {@code TextField} + * Constructs an instance of {@link TextField} * with the specified field and values. * * @param field the field @@ -920,7 +921,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final int mField; /** - * Constructs an instance of {@code UnpadedNumberField} with the specified field. + * Constructs an instance of {@link UnpadedNumberField} with the specified field. * * @param field the field */ @@ -966,7 +967,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { static final UnpaddedMonthField INSTANCE = new UnpaddedMonthField(); /** - * Constructs an instance of {@code UnpaddedMonthField}. + * Constructs an instance of {@link UnpaddedMonthField}. * */ UnpaddedMonthField() { @@ -1009,7 +1010,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final int mSize; /** - * Constructs an instance of {@code PaddedNumberField}. + * Constructs an instance of {@link PaddedNumberField}. * * @param field the field * @param size size of the output field @@ -1055,7 +1056,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final int mField; /** - * Constructs an instance of {@code TwoDigitNumberField} with the specified field. + * Constructs an instance of {@link TwoDigitNumberField} with the specified field. * * @param field the field */ @@ -1099,7 +1100,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { static final TwoDigitYearField INSTANCE = new TwoDigitYearField(); /** - * Constructs an instance of {@code TwoDigitYearField}. + * Constructs an instance of {@link TwoDigitYearField}. */ TwoDigitYearField() { } @@ -1136,7 +1137,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { static final TwoDigitMonthField INSTANCE = new TwoDigitMonthField(); /** - * Constructs an instance of {@code TwoDigitMonthField}. + * Constructs an instance of {@link TwoDigitMonthField}. */ TwoDigitMonthField() { } @@ -1173,8 +1174,8 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final NumberRule mRule; /** - * Constructs an instance of {@code TwelveHourField} with the specified - * {@code NumberRule}. + * Constructs an instance of {@link TwelveHourField} with the specified + * {@link NumberRule}. * * @param rule the rule */ @@ -1218,8 +1219,8 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final NumberRule mRule; /** - * Constructs an instance of {@code TwentyFourHourField} with the specified - * {@code NumberRule}. + * Constructs an instance of {@link TwentyFourHourField} with the specified + * {@link NumberRule}. * * @param rule the rule */ @@ -1338,7 +1339,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final String mDaylight; /** - * Constructs an instance of {@code TimeZoneNameRule} with the specified properties. + * Constructs an instance of {@link TimeZoneNameRule} with the specified properties. * * @param timeZone the time zone * @param locale the locale @@ -1388,7 +1389,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { final boolean mColon; /** - * Constructs an instance of {@code TimeZoneNumberRule} with the specified properties. + * Constructs an instance of {@link TimeZoneNumberRule} with the specified properties. * * @param colon add colon between HH and MM in the output if {@code true} */ @@ -1526,7 +1527,7 @@ public class FastDatePrinter implements DatePrinter, Serializable { private final Locale mLocale; /** - * Constructs an instance of {@code TimeZoneDisplayKey} with the specified properties. + * Constructs an instance of {@link TimeZoneDisplayKey} with the specified properties. * * @param timeZone the time zone * @param daylight adjust the style for daylight saving time if {@code true} diff --git a/src/main/java/org/apache/commons/lang3/time/FormatCache.java b/src/main/java/org/apache/commons/lang3/time/FormatCache.java index e97d98256..5ce458d25 100644 --- a/src/main/java/org/apache/commons/lang3/time/FormatCache.java +++ b/src/main/java/org/apache/commons/lang3/time/FormatCache.java @@ -208,7 +208,7 @@ abstract class FormatCache<F extends Format> { private final int hashCode; /** - * Constructs an instance of {@code MultipartKey} to hold the specified objects. + * Constructs an instance of {@link MultipartKey} to hold the specified objects. * * @param keys the set of objects that make up the key. Each key may be null. */ diff --git a/src/main/java/org/apache/commons/lang3/time/StopWatch.java b/src/main/java/org/apache/commons/lang3/time/StopWatch.java index 9a82cbd3d..a44f40036 100644 --- a/src/main/java/org/apache/commons/lang3/time/StopWatch.java +++ b/src/main/java/org/apache/commons/lang3/time/StopWatch.java @@ -24,7 +24,7 @@ import org.apache.commons.lang3.StringUtils; /** * <p> - * {@code StopWatch} provides a convenient API for timings. + * {@link StopWatch} provides a convenient API for timings. * </p> * * <p> |