Package com.wireguard.config
Class InetEndpoint
- java.lang.Object
-
- com.wireguard.config.InetEndpoint
-
public final class InetEndpoint extends java.lang.ObjectAn external endpoint (host and port) used to connect to a WireGuardPeer.Instances of this class are externally immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetHost()intgetPort()java.util.Optional<InetEndpoint>getResolved()Generate anInetEndpointinstance with the same port and the host resolved using DNS to a numeric address.inthashCode()static InetEndpointparse(java.lang.String endpoint)java.lang.StringtoString()
-
-
-
Method Detail
-
parse
public static InetEndpoint parse(java.lang.String endpoint) throws ParseException
- Throws:
ParseException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getHost
public java.lang.String getHost()
-
getPort
public int getPort()
-
getResolved
public java.util.Optional<InetEndpoint> getResolved()
Generate anInetEndpointinstance with the same port and the host resolved using DNS to a numeric address. If the host is already numeric, the existing instance may be returned. Because this function may perform network I/O, it must not be called from the main thread.- Returns:
- the resolved endpoint, or
Optional.empty()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-