We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4d35ce commit ea0efb1Copy full SHA for ea0efb1
vertx-pg-client/src/main/java/io/vertx/pgclient/data/Cidr.java
@@ -11,12 +11,15 @@ public class Cidr {
11
private InetAddress address;
12
private Integer netmask;
13
14
-
15
public InetAddress getAddress(){
16
return address;
17
}
18
- public Cidr setAddress(InetAddress address){
19
- this.address=address;
+ public Cidr setAddress(InetAddress address) {
+ if (address instanceof Inet4Address || address instanceof Inet6Address) {
+ this.address = address;
20
+ } else {
21
+ throw new IllegalArgumentException("Invalid IP address type");
22
+ }
23
return this;
24
25
0 commit comments