Skip to content

Commit f276fda

Browse files
committed
Rename the configuration method into something unrelated to functional-style programming.
1 parent 61c41ff commit f276fda

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

server/src/main/java/io/spine/server/GrpcContainer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private static ServerBuilder<?> builderAtPort(Integer port, @Nullable Executor e
333333
*
334334
* <p>All calls to {@link #createGrpcServer(Executor)} will resolve to the given server
335335
* instance. The server instance is used as-is, no other
336-
* {@linkplain Builder#apply(ConfigureServer) configuration methods} have any effect on it.
336+
* {@linkplain Builder#withServer(ConfigureServer) configuration methods} have any effect on it.
337337
*
338338
* <p>A test-only method.
339339
*/
@@ -444,7 +444,7 @@ public Builder removeService(ServerServiceDefinition service) {
444444

445445
/**
446446
* Sets an additional configuration action for the gRPC {@link Server} instance,
447-
* created for this {@code GrpcContainer} to run on top of. This action is applied
447+
* created for this {@code GrpcContainer} to run on top of. This configuration is applied
448448
* right before the {@linkplain #start() server is started}.
449449
*
450450
* <p>Allows the direct access to gRPC {@link ServerBuilder}'s API.
@@ -456,7 +456,7 @@ public Builder removeService(ServerServiceDefinition service) {
456456
*/
457457
@Experimental
458458
@CanIgnoreReturnValue
459-
public Builder apply(ConfigureServer action) {
459+
public Builder withServer(ConfigureServer action) {
460460
this.configureServer = checkNotNull(action);
461461
return this;
462462
}
@@ -497,15 +497,15 @@ public GrpcContainer build() {
497497
*
498498
* GrpcContainer container =
499499
* GrpcContainer.atPort(1654)
500-
* {@literal .apply((server) -> server.maxInboundMessageSize(16_000_000)) }
500+
* {@literal .withServer((server) -> server.maxInboundMessageSize(16_000_000)) }
501501
* // ...
502502
* .build();
503503
*
504504
* </pre>
505505
*
506506
* <p>Please note this interface is a part of experimental API.
507507
*
508-
* @see Builder#apply(ConfigureServer)
508+
* @see Builder#withServer(ConfigureServer)
509509
*/
510510
@Experimental
511511
@FunctionalInterface

server/src/test/java/io/spine/server/GrpcContainerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void configureUnderlyingGrpcServer() {
118118
.build();
119119
GrpcContainer container =
120120
GrpcContainer.atPort(port)
121-
.apply((server) -> server.addService(service))
121+
.withServer((server) -> server.addService(service))
122122
.build();
123123
try {
124124
container.start();

0 commit comments

Comments
 (0)