Because this class is intended to represent host specifiers which can reasonably be used in a
URI, the domain name case is further restricted to include only those domain names which end in a
recognized public suffix; see InternetDomainName#isPublicSuffix() for details.
Note that no network lookups are performed by any HostSpecifier methods. No attempt is
made to verify that a provided specifier corresponds to a real or accessible host. Only syntactic
and pattern-based checks are performed.
If you know that a given string represents a numeric IP address, use InetAddresses to
obtain and manipulate a java. instance from it rather than using this
class. Similarly, if you know that a given string represents a domain name, use InternetDomainName rather than this class.
| Modifier and Type | Field and Description |
|---|---|
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public static HostSpecifier | |
| public static HostSpecifier | |
| public int | |
| public static boolean | isValid(String specifier)
Determines whether |
| public String | toString()
Overrides java. |
| canonicalForm | back to summary |
|---|---|
| private final String canonicalForm | |
| HostSpecifier | back to summary |
|---|---|
| private HostSpecifier(String canonicalForm) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| from | back to summary |
|---|---|
| public static HostSpecifier from(String specifier) throws ParseException Attempts to return a
| |
| fromValid | back to summary |
|---|---|
| public static HostSpecifier fromValid(String specifier) Returns a The specifier must be in one of these formats:
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isValid | back to summary |
|---|---|
| public static boolean isValid(String specifier) Determines whether | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of the host specifier suitable for inclusion in a URI. If the host specifier is a domain name, the string will be normalized to all lower case. If the specifier was an IPv6 address without brackets, brackets are added so that the result will be usable in the host part of a URI.
| |