Package org.jivesoftware.smack.util
Class InternetAddress
- java.lang.Object
-
- org.jivesoftware.smack.util.InternetAddress
-
- All Implemented Interfaces:
CharSequence
- Direct Known Subclasses:
InternetAddress.DomainName
,InternetAddress.DomainNameLabel
,InternetAddress.InvalidDomainName
,InternetAddress.Ipv4
,InternetAddress.Ipv6
public abstract class InternetAddress extends Object implements CharSequence
An internet address, can be given as IP or as DNS name.This type is meant for strings that hold an internet address. The original string used to construct this type is stored and returning in the
toString()
method.- Since:
- 4.4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InternetAddress.DomainName
static class
InternetAddress.DomainNameLabel
static class
InternetAddress.InvalidDomainName
static class
InternetAddress.Ipv4
static class
InternetAddress.Ipv6
-
Field Summary
Fields Modifier and Type Field Description protected String
originalString
-
Constructor Summary
Constructors Modifier Constructor Description protected
InternetAddress(String originalString)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract InetAddress
asInetAddress()
char
charAt(int index)
static InternetAddress
from(String address)
static InternetAddress
from(InetAddress inetAddress)
int
length()
CharSequence
subSequence(int start, int end)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Field Detail
-
originalString
protected final String originalString
-
-
Constructor Detail
-
InternetAddress
protected InternetAddress(String originalString)
-
-
Method Detail
-
asInetAddress
public abstract InetAddress asInetAddress() throws UnknownHostException
- Throws:
UnknownHostException
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
subSequence
public CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
from
public static InternetAddress from(String address)
-
from
public static InternetAddress from(InetAddress inetAddress)
-
-