Skip to content

Commit 69de8be

Browse files
committed
move validateGreaterThanOrEqual
1 parent bc8de5a commit 69de8be

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

core/src/main/java/com/linecorp/armeria/server/DefaultServerConfig.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,6 @@ static Duration validateNonNegative(Duration duration, String fieldName) {
360360
return duration;
361361
}
362362

363-
static void validateGreaterThanOrEqual(Duration larger, String largerFieldName,
364-
Duration smaller, String smallerFieldName) {
365-
if (larger.compareTo(smaller) < 0) {
366-
throw new IllegalArgumentException(largerFieldName + " must be greater than or equal to " +
367-
smallerFieldName);
368-
}
369-
}
370-
371363
@Override
372364
public Server server() {
373365
if (server == null) {

core/src/main/java/com/linecorp/armeria/server/GracefulShutdownBuilder.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.linecorp.armeria.server;
1818

19-
import static com.linecorp.armeria.server.DefaultServerConfig.validateGreaterThanOrEqual;
2019
import static com.linecorp.armeria.server.DefaultServerConfig.validateNonNegative;
2120
import static java.util.Objects.requireNonNull;
2221

@@ -107,6 +106,14 @@ public GracefulShutdownBuilder toExceptionFunction(
107106
return this;
108107
}
109108

109+
private static void validateGreaterThanOrEqual(Duration larger, String largerFieldName,
110+
Duration smaller, String smallerFieldName) {
111+
if (larger.compareTo(smaller) < 0) {
112+
throw new IllegalArgumentException(largerFieldName + " must be greater than or equal to " +
113+
smallerFieldName);
114+
}
115+
}
116+
110117
/**
111118
* Builds a new {@link GracefulShutdown} with the configured parameters.
112119
*/

0 commit comments

Comments
 (0)