From 1a87fce416d844351de40e29ff9a7628e7eb4406 Mon Sep 17 00:00:00 2001 From: OrangeDog <675056+OrangeDog@users.noreply.github.com> Date: Tue, 26 May 2020 14:35:08 +0100 Subject: [PATCH] Polish duration support javadoc See gh-21579 --- .../org/springframework/boot/convert/DurationStyle.java | 6 +++--- .../java/org/springframework/boot/convert/PeriodStyle.java | 6 +++--- .../boot/convert/PeriodToStringConverter.java | 3 ++- .../boot/convert/StringToPeriodConverter.java | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java index 631fae85a4a..63ff1704ec3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java @@ -134,7 +134,7 @@ public enum DurationStyle { * Detect the style then parse the value to return a duration. * @param value the value to parse * @return the parsed duration - * @throws IllegalStateException if the value is not a known style or cannot be parsed + * @throws IllegalArgumentException if the value is not a known style or cannot be parsed */ public static Duration detectAndParse(String value) { return detectAndParse(value, null); @@ -146,7 +146,7 @@ public enum DurationStyle { * @param unit the duration unit to use if the value doesn't specify one ({@code null} * will default to ms) * @return the parsed duration - * @throws IllegalStateException if the value is not a known style or cannot be parsed + * @throws IllegalArgumentException if the value is not a known style or cannot be parsed */ public static Duration detectAndParse(String value, ChronoUnit unit) { return detect(value).parse(value, unit); @@ -156,7 +156,7 @@ public enum DurationStyle { * Detect the style from the given source value. * @param value the source value * @return the duration style - * @throws IllegalStateException if the value is not a known style + * @throws IllegalArgumentException if the value is not a known style */ public static DurationStyle detect(String value) { Assert.notNull(value, "Value must not be null"); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java index 5ea887b95ee..228fdf28eb7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java @@ -176,7 +176,7 @@ public enum PeriodStyle { * Detect the style then parse the value to return a period. * @param value the value to parse * @return the parsed period - * @throws IllegalStateException if the value is not a known style or cannot be parsed + * @throws IllegalArgumentException if the value is not a known style or cannot be parsed */ public static Period detectAndParse(String value) { return detectAndParse(value, null); @@ -188,7 +188,7 @@ public enum PeriodStyle { * @param unit the period unit to use if the value doesn't specify one ({@code null} * will default to ms) * @return the parsed period - * @throws IllegalStateException if the value is not a known style or cannot be parsed + * @throws IllegalArgumentException if the value is not a known style or cannot be parsed */ public static Period detectAndParse(String value, ChronoUnit unit) { return detect(value).parse(value, unit); @@ -198,7 +198,7 @@ public enum PeriodStyle { * Detect the style from the given source value. * @param value the source value * @return the period style - * @throws IllegalStateException if the value is not a known style + * @throws IllegalArgumentException if the value is not a known style */ public static PeriodStyle detect(String value) { Assert.notNull(value, "Value must not be null"); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodToStringConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodToStringConverter.java index c157c05cd72..2cc840b78c4 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodToStringConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodToStringConverter.java @@ -32,7 +32,8 @@ import org.springframework.util.ObjectUtils; * @author Eddú Meléndez * @author Edson Chávez * @since 2.3.0 - * @see Period + * @see PeriodFormat + * @see PeriodUnit */ public class PeriodToStringConverter implements GenericConverter { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToPeriodConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToPeriodConverter.java index e15bfd29468..d16e133af1f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToPeriodConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToPeriodConverter.java @@ -33,6 +33,7 @@ import org.springframework.util.ObjectUtils; * @author Eddú Meléndez * @author Edson Chávez * @since 2.3.0 + * @see PeriodFormat * @see PeriodUnit */ public class StringToPeriodConverter implements GenericConverter {