Skip to content

Commit 1a87fce

Browse files
OrangeDogsnicoll
authored andcommitted
Polish duration support javadoc
See gh-21579
1 parent 9cf4488 commit 1a87fce

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public String print(Duration value) {
134134
* Detect the style then parse the value to return a duration.
135135
* @param value the value to parse
136136
* @return the parsed duration
137-
* @throws IllegalStateException if the value is not a known style or cannot be parsed
137+
* @throws IllegalArgumentException if the value is not a known style or cannot be parsed
138138
*/
139139
public static Duration detectAndParse(String value) {
140140
return detectAndParse(value, null);
@@ -146,7 +146,7 @@ public static Duration detectAndParse(String value) {
146146
* @param unit the duration unit to use if the value doesn't specify one ({@code null}
147147
* will default to ms)
148148
* @return the parsed duration
149-
* @throws IllegalStateException if the value is not a known style or cannot be parsed
149+
* @throws IllegalArgumentException if the value is not a known style or cannot be parsed
150150
*/
151151
public static Duration detectAndParse(String value, ChronoUnit unit) {
152152
return detect(value).parse(value, unit);
@@ -156,7 +156,7 @@ public static Duration detectAndParse(String value, ChronoUnit unit) {
156156
* Detect the style from the given source value.
157157
* @param value the source value
158158
* @return the duration style
159-
* @throws IllegalStateException if the value is not a known style
159+
* @throws IllegalArgumentException if the value is not a known style
160160
*/
161161
public static DurationStyle detect(String value) {
162162
Assert.notNull(value, "Value must not be null");

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public String print(Period value) {
176176
* Detect the style then parse the value to return a period.
177177
* @param value the value to parse
178178
* @return the parsed period
179-
* @throws IllegalStateException if the value is not a known style or cannot be parsed
179+
* @throws IllegalArgumentException if the value is not a known style or cannot be parsed
180180
*/
181181
public static Period detectAndParse(String value) {
182182
return detectAndParse(value, null);
@@ -188,7 +188,7 @@ public static Period detectAndParse(String value) {
188188
* @param unit the period unit to use if the value doesn't specify one ({@code null}
189189
* will default to ms)
190190
* @return the parsed period
191-
* @throws IllegalStateException if the value is not a known style or cannot be parsed
191+
* @throws IllegalArgumentException if the value is not a known style or cannot be parsed
192192
*/
193193
public static Period detectAndParse(String value, ChronoUnit unit) {
194194
return detect(value).parse(value, unit);
@@ -198,7 +198,7 @@ public static Period detectAndParse(String value, ChronoUnit unit) {
198198
* Detect the style from the given source value.
199199
* @param value the source value
200200
* @return the period style
201-
* @throws IllegalStateException if the value is not a known style
201+
* @throws IllegalArgumentException if the value is not a known style
202202
*/
203203
public static PeriodStyle detect(String value) {
204204
Assert.notNull(value, "Value must not be null");

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodToStringConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
* @author Eddú Meléndez
3333
* @author Edson Chávez
3434
* @since 2.3.0
35-
* @see Period
35+
* @see PeriodFormat
36+
* @see PeriodUnit
3637
*/
3738
public class PeriodToStringConverter implements GenericConverter {
3839

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToPeriodConverter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @author Eddú Meléndez
3434
* @author Edson Chávez
3535
* @since 2.3.0
36+
* @see PeriodFormat
3637
* @see PeriodUnit
3738
*/
3839
public class StringToPeriodConverter implements GenericConverter {

0 commit comments

Comments
 (0)