Skip to content

Commit 1975cf4

Browse files
committed
Merge pull request #21579 from OrangeDog
* pr/21579: Polish "Polish duration support javadoc" Polish duration support javadoc Closes gh-21579
2 parents 9cf4488 + b21c090 commit 1975cf4

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ 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
138+
* parsed
138139
*/
139140
public static Duration detectAndParse(String value) {
140141
return detectAndParse(value, null);
@@ -146,7 +147,8 @@ public static Duration detectAndParse(String value) {
146147
* @param unit the duration unit to use if the value doesn't specify one ({@code null}
147148
* will default to ms)
148149
* @return the parsed duration
149-
* @throws IllegalStateException if the value is not a known style or cannot be parsed
150+
* @throws IllegalArgumentException if the value is not a known style or cannot be
151+
* parsed
150152
*/
151153
public static Duration detectAndParse(String value, ChronoUnit unit) {
152154
return detect(value).parse(value, unit);
@@ -156,7 +158,7 @@ public static Duration detectAndParse(String value, ChronoUnit unit) {
156158
* Detect the style from the given source value.
157159
* @param value the source value
158160
* @return the duration style
159-
* @throws IllegalStateException if the value is not a known style
161+
* @throws IllegalArgumentException if the value is not a known style
160162
*/
161163
public static DurationStyle detect(String value) {
162164
Assert.notNull(value, "Value must not be null");

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ 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
180+
* parsed
180181
*/
181182
public static Period detectAndParse(String value) {
182183
return detectAndParse(value, null);
@@ -188,7 +189,8 @@ public static Period detectAndParse(String value) {
188189
* @param unit the period unit to use if the value doesn't specify one ({@code null}
189190
* will default to ms)
190191
* @return the parsed period
191-
* @throws IllegalStateException if the value is not a known style or cannot be parsed
192+
* @throws IllegalArgumentException if the value is not a known style or cannot be
193+
* parsed
192194
*/
193195
public static Period detectAndParse(String value, ChronoUnit unit) {
194196
return detect(value).parse(value, unit);
@@ -198,7 +200,7 @@ public static Period detectAndParse(String value, ChronoUnit unit) {
198200
* Detect the style from the given source value.
199201
* @param value the source value
200202
* @return the period style
201-
* @throws IllegalStateException if the value is not a known style
203+
* @throws IllegalArgumentException if the value is not a known style
202204
*/
203205
public static PeriodStyle detect(String value) {
204206
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)