Skip to content

Commit

Permalink
revert: whitespaces in NetworkConfigurationServiceProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdibi committed Oct 8, 2024
1 parent d5d81ff commit 300f24d
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public String getIp4DnsServers(String ifname) {
public void setIp4DnsServers(String ifname, String dnsServers) {
this.properties.put(String.format(NET_INTERFACE_CONFIG_IP4_DNS_SERVERS, ifname), dnsServers);
}

/*
* IPv6 properties
*/
Expand All @@ -159,7 +159,7 @@ public void setIp4DnsServers(String ifname, String dnsServers) {
private static final String NET_INTERFACE_CONFIG_IP6_NETMASK = "net.interface.%s.config.ip6.prefix";
private static final String NET_INTERFACE_CONFIG_IP6_GATEWAY = "net.interface.%s.config.ip6.gateway";
private static final String NET_INTERFACE_CONFIG_IP6_DNS_SERVERS = "net.interface.%s.config.ip6.dnsServers";

public Optional<String> getIp6Status(String ifname) {
return getNonEmptyStringProperty(this.properties.get(String.format(NET_INTERFACE_CONFIG_IP6_STATUS, ifname)));
}
Expand Down Expand Up @@ -239,7 +239,7 @@ public String getIp6DnsServers(String ifname) {
public void setIp6DnsServers(String ifname, String dnsServers) {
this.properties.put(String.format(NET_INTERFACE_CONFIG_IP6_DNS_SERVERS, ifname), dnsServers);
}

/*
* IPv4 DHCP Server properties
*/
Expand Down Expand Up @@ -897,22 +897,23 @@ public String get8021xPublicPrivateKeyPairName(String ifname) {
return (String) this.properties
.get(String.format(NET_INTERFACE_CONFIG_8021X_PUBLIC_PRIVATE_KEY_PAIR_NAME, ifname));
}

/**
* Advanced properties
*/
private static final String NET_INTERFACE_CONFIG_IP4_MTU = "net.interface.%s.config.ip4.mtu";
private static final String NET_INTERFACE_CONFIG_IP6_MTU = "net.interface.%s.config.ip6.mtu";
private static final String NET_INTERFACE_CONFIG_PROMISC_MODE = "net.interface.%s.config.promisc";

public Optional<Integer> getIp4Mtu(String ifName) {
return Optional.ofNullable((Integer) properties.get(String.format(NET_INTERFACE_CONFIG_IP4_MTU, ifName)));
return Optional.ofNullable(
(Integer) properties.get(String.format(NET_INTERFACE_CONFIG_IP4_MTU, ifName)));
}

public void setIp4Mtu(String ifName, int mtu) {
this.properties.put(String.format(NET_INTERFACE_CONFIG_IP4_MTU, ifName), mtu);
this.properties.put(String.format(NET_INTERFACE_CONFIG_IP4_MTU, ifName), mtu);
}

public Optional<Integer> getIp6Mtu(String ifname) {
if (this.properties.containsKey(String.format(NET_INTERFACE_CONFIG_IP6_MTU, ifname))) {
Integer mtu = (Integer) this.properties.get(String.format(NET_INTERFACE_CONFIG_IP6_MTU, ifname));
Expand All @@ -922,9 +923,9 @@ public Optional<Integer> getIp6Mtu(String ifname) {
}

public void setIp6Mtu(String ifname, Integer mtu) {
this.properties.put(String.format(NET_INTERFACE_CONFIG_IP6_MTU, ifname), mtu);
this.properties.put(String.format(NET_INTERFACE_CONFIG_IP6_MTU, ifname), mtu);
}

public Optional<Integer> getPromisc(String ifname) {
if (this.properties.containsKey(String.format(NET_INTERFACE_CONFIG_PROMISC_MODE, ifname))) {
Integer mtu = (Integer) this.properties.get(String.format(NET_INTERFACE_CONFIG_PROMISC_MODE, ifname));
Expand All @@ -934,7 +935,7 @@ public Optional<Integer> getPromisc(String ifname) {
}

public void setPromisc(String ifname, Integer promisc) {
this.properties.put(String.format(NET_INTERFACE_CONFIG_PROMISC_MODE, ifname), promisc);
this.properties.put(String.format(NET_INTERFACE_CONFIG_PROMISC_MODE, ifname), promisc);
}

/**
Expand Down

0 comments on commit 300f24d

Please sign in to comment.