Skip to content

Commit e3db28d

Browse files
committed
Rename CacheOptions getShared to isShared
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 55fdd36 commit e3db28d

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

src/main/generated/io/vertx/httpproxy/cache/CacheOptionsConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ static void toJson(CacheOptions obj, java.util.Map<String, Object> json) {
4242
if (obj.getName() != null) {
4343
json.put("name", obj.getName());
4444
}
45-
json.put("shared", obj.getShared());
45+
json.put("shared", obj.isShared());
4646
}
4747
}

src/main/java/io/vertx/httpproxy/cache/CacheOptions.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* Copyright (c) 2011-2025 Contributors to the Eclipse Foundation
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
*
9+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
*/
11+
112
package io.vertx.httpproxy.cache;
213

314
import io.vertx.codegen.annotations.DataObject;
@@ -46,7 +57,7 @@ public CacheOptions() {
4657
public CacheOptions(CacheOptions other) {
4758
this.maxSize = other.getMaxSize();
4859
this.name = other.getName();
49-
this.shared = other.getShared();
60+
this.shared = other.isShared();
5061
}
5162

5263
/**
@@ -100,7 +111,7 @@ public CacheOptions setName(String name) {
100111
/**
101112
* @return whether the cache is shared
102113
*/
103-
public boolean getShared() {
114+
public boolean isShared() {
104115
return shared;
105116
}
106117

src/main/java/io/vertx/httpproxy/impl/ReverseProxy.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011-2020 Contributors to the Eclipse Foundation
2+
* Copyright (c) 2011-2025 Contributors to the Eclipse Foundation
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License 2.0 which is available at
@@ -11,21 +11,36 @@
1111
package io.vertx.httpproxy.impl;
1212

1313
import io.vertx.core.Future;
14-
import io.vertx.core.buffer.Buffer;
1514
import io.vertx.core.Vertx;
16-
import io.vertx.core.http.*;
15+
import io.vertx.core.buffer.Buffer;
16+
import io.vertx.core.http.HttpClient;
17+
import io.vertx.core.http.HttpClientRequest;
18+
import io.vertx.core.http.HttpClientResponse;
19+
import io.vertx.core.http.HttpHeaders;
20+
import io.vertx.core.http.HttpServerRequest;
21+
import io.vertx.core.http.HttpServerResponse;
1722
import io.vertx.core.internal.CloseFuture;
1823
import io.vertx.core.internal.VertxInternal;
19-
import io.vertx.core.internal.http.*;
24+
import io.vertx.core.internal.http.HttpClientInternal;
2025
import io.vertx.core.internal.logging.Logger;
2126
import io.vertx.core.internal.logging.LoggerFactory;
2227
import io.vertx.core.net.NetSocket;
2328
import io.vertx.core.streams.ReadStream;
24-
import io.vertx.httpproxy.*;
29+
import io.vertx.httpproxy.HttpProxy;
30+
import io.vertx.httpproxy.ProxyContext;
31+
import io.vertx.httpproxy.ProxyInterceptor;
32+
import io.vertx.httpproxy.ProxyOptions;
33+
import io.vertx.httpproxy.ProxyRequest;
34+
import io.vertx.httpproxy.ProxyResponse;
2535
import io.vertx.httpproxy.cache.CacheOptions;
2636
import io.vertx.httpproxy.spi.cache.Cache;
2737

28-
import java.util.*;
38+
import java.util.ArrayList;
39+
import java.util.HashMap;
40+
import java.util.List;
41+
import java.util.ListIterator;
42+
import java.util.Map;
43+
import java.util.Objects;
2944
import java.util.function.BiFunction;
3045

3146
import static io.vertx.core.http.HttpHeaders.CONNECTION;
@@ -50,7 +65,7 @@ public ReverseProxy(ProxyOptions options, HttpClient client) {
5065
}
5166

5267
public Cache newCache(CacheOptions options, Vertx vertx) {
53-
if (options.getShared()) {
68+
if (options.isShared()) {
5469
CloseFuture closeFuture = new CloseFuture();
5570
return ((VertxInternal) vertx).createSharedResource("__vertx.shared.proxyCache", options.getName(), closeFuture, (cf_) -> {
5671
return new CacheImpl(options);

0 commit comments

Comments
 (0)