Package io.openems.edge.core.appmanager
Class InterfaceConfiguration
- java.lang.Object
-
- io.openems.edge.core.appmanager.InterfaceConfiguration
-
public class InterfaceConfiguration extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
interfaceName
e.
-
Constructor Summary
Constructors Constructor Description InterfaceConfiguration(java.lang.String interfaceName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InterfaceConfiguration
addIp(Inet4AddressWithSubnetmask ip)
Adds an ip to the list.InterfaceConfiguration
addIp(java.lang.String ip)
Adds an ip to the list with usingInet4AddressWithSubnetmask.fromString(String)
.InterfaceConfiguration
addIp(java.lang.String label, java.lang.String ip)
Adds an ip to the list with usingInet4AddressWithSubnetmask.fromString(String, String)
.boolean
equals(java.lang.Object obj)
java.util.List<Inet4AddressWithSubnetmask>
getIps()
int
hashCode()
static void
removeDuplicatedIps(java.util.List<InterfaceConfiguration> listToRemove, java.util.List<InterfaceConfiguration> other)
Removes ip's from thelistToRemove
if the ip-address is in both lists.static java.util.List<InterfaceConfiguration>
summarize(java.util.List<InterfaceConfiguration> interfaceConfiguration)
Summarizes the duplicated interfaces into one.java.lang.String
toString()
-
-
-
Method Detail
-
addIp
public InterfaceConfiguration addIp(Inet4AddressWithSubnetmask ip)
Adds an ip to the list.- Parameters:
ip
- theInet4AddressWithSubnetmask
to add- Returns:
- this
-
addIp
public InterfaceConfiguration addIp(java.lang.String ip) throws OpenemsException
Adds an ip to the list with usingInet4AddressWithSubnetmask.fromString(String)
.- Parameters:
ip
- theInet4AddressWithSubnetmask
to add- Returns:
- this
- Throws:
OpenemsException
- ifInet4AddressWithSubnetmask.fromString(String)
throws an error
-
addIp
public InterfaceConfiguration addIp(java.lang.String label, java.lang.String ip) throws OpenemsException
Adds an ip to the list with usingInet4AddressWithSubnetmask.fromString(String, String)
.- Parameters:
label
- the label of the ipip
- theInet4AddressWithSubnetmask
to add- Returns:
- this
- Throws:
OpenemsException
- ifInet4AddressWithSubnetmask.fromString(String)
throws an error
-
getIps
public java.util.List<Inet4AddressWithSubnetmask> getIps()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
summarize
public static java.util.List<InterfaceConfiguration> summarize(java.util.List<InterfaceConfiguration> interfaceConfiguration)
Summarizes the duplicated interfaces into one.- Parameters:
interfaceConfiguration
- the configurations to summarize- Returns:
- the interfaces
-
removeDuplicatedIps
public static void removeDuplicatedIps(java.util.List<InterfaceConfiguration> listToRemove, java.util.List<InterfaceConfiguration> other)
Removes ip's from thelistToRemove
if the ip-address is in both lists.- Parameters:
listToRemove
- the list to remove the ip'sother
- the other interfaces
-
-