Class InetAddressStringConverter

java.lang.Object
org.tquadrat.foundation.util.stringconverter.InetAddressStringConverter
All Implemented Interfaces:
Serializable, StringConverter<InetAddress>

@ClassVersion(sourceVersion="$Id: InetAddressStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $") @API(status=STABLE, since="0.0.6") public final class InetAddressStringConverter extends Object implements StringConverter<InetAddress>
The implementation of StringConverter for InetAddress values.

The method fromString(CharSequence) will use InetAddress.getByName(String) to create a InetAddress instance from the given value; this means, that when a host name is given as an argument – instead of an IP4 or IP6 address String – an IllegalArgumentException is thrown when that host is unknown (cannot be resolved by DNS). But fromString() will not accept null or the empty String for localhost; for these values it will also throw an IllegalArgumentException.

The method toString(InetAddress) uses InetAddress.getHostAddress() to get the IP address as a String.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: InetAddressStringConverter.java 1060 2023-09-24 19:21:40Z tquadrat $
Since:
0.0.6
See Also:
UML Diagram
UML Diagram for "org.tquadrat.foundation.util.stringconverter.InetAddressStringConverter"

UML Diagram for "org.tquadrat.foundation.util.stringconverter.InetAddressStringConverter"

UML Diagram for "org.tquadrat.foundation.util.stringconverter.InetAddressStringConverter"