Package org.jivesoftware.smack.util
Class InternetAddress
- java.lang.Object
-
- org.jivesoftware.smack.util.InternetAddress
-
- All Implemented Interfaces:
java.lang.CharSequence
- Direct Known Subclasses:
InternetAddress.DomainName
,InternetAddress.DomainNameLabel
,InternetAddress.InvalidDomainName
,InternetAddress.Ipv4
,InternetAddress.Ipv6
public abstract class InternetAddress extends java.lang.Object implements java.lang.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 java.lang.String
originalString
-
Constructor Summary
Constructors Modifier Constructor Description protected
InternetAddress(java.lang.String originalString)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.net.InetAddress
asInetAddress()
char
charAt(int index)
static InternetAddress
from(java.lang.String address)
static InternetAddress
from(java.net.InetAddress inetAddress)
static InternetAddress
fromIgnoringZoneId(java.lang.String address)
java.lang.String
getRaw()
int
length()
java.lang.CharSequence
subSequence(int start, int end)
java.lang.String
toString()
-
-
-
Field Detail
-
originalString
protected final java.lang.String originalString
-
-
Constructor Detail
-
InternetAddress
protected InternetAddress(java.lang.String originalString)
-
-
Method Detail
-
asInetAddress
public abstract java.net.InetAddress asInetAddress() throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.lang.CharSequence
- Overrides:
toString
in classjava.lang.Object
-
length
public int length()
- Specified by:
length
in interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
getRaw
public java.lang.String getRaw()
-
fromIgnoringZoneId
public static InternetAddress fromIgnoringZoneId(java.lang.String address)
-
from
public static InternetAddress from(java.lang.String address)
-
from
public static InternetAddress from(java.net.InetAddress inetAddress)
-
-