Skip to content

Commit

Permalink
move validateGreaterThanOrEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhoon committed Dec 11, 2024
1 parent bc8de5a commit 69de8be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,6 @@ static Duration validateNonNegative(Duration duration, String fieldName) {
return duration;
}

static void validateGreaterThanOrEqual(Duration larger, String largerFieldName,
Duration smaller, String smallerFieldName) {
if (larger.compareTo(smaller) < 0) {
throw new IllegalArgumentException(largerFieldName + " must be greater than or equal to " +
smallerFieldName);
}
}

@Override
public Server server() {
if (server == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.linecorp.armeria.server;

import static com.linecorp.armeria.server.DefaultServerConfig.validateGreaterThanOrEqual;
import static com.linecorp.armeria.server.DefaultServerConfig.validateNonNegative;
import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -107,6 +106,14 @@ public GracefulShutdownBuilder toExceptionFunction(
return this;
}

private static void validateGreaterThanOrEqual(Duration larger, String largerFieldName,
Duration smaller, String smallerFieldName) {
if (larger.compareTo(smaller) < 0) {
throw new IllegalArgumentException(largerFieldName + " must be greater than or equal to " +
smallerFieldName);
}
}

/**
* Builds a new {@link GracefulShutdown} with the configured parameters.
*/
Expand Down

0 comments on commit 69de8be

Please sign in to comment.