Browse Source

Merge pull request #21579 from OrangeDog

* pr/21579:
  Polish "Polish duration support javadoc"
  Polish duration support javadoc

Closes gh-21579
pull/21581/head
Stephane Nicoll 6 years ago
parent
commit
1975cf498c
  1. 8
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DurationStyle.java
  2. 8
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodStyle.java
  3. 3
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/PeriodToStringConverter.java
  4. 1
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/StringToPeriodConverter.java

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

@ -134,7 +134,8 @@ public enum DurationStyle { @@ -134,7 +134,8 @@ 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 +147,8 @@ public enum DurationStyle { @@ -146,7 +147,8 @@ 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 +158,7 @@ public enum DurationStyle { @@ -156,7 +158,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");

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

@ -176,7 +176,8 @@ public enum PeriodStyle { @@ -176,7 +176,8 @@ 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 +189,8 @@ public enum PeriodStyle { @@ -188,7 +189,8 @@ 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 +200,7 @@ public enum PeriodStyle { @@ -198,7 +200,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");

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

@ -32,7 +32,8 @@ import org.springframework.util.ObjectUtils; @@ -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 {

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

@ -33,6 +33,7 @@ import org.springframework.util.ObjectUtils; @@ -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 {

Loading…
Cancel
Save