public final class HostPort extends GenericObject
Modifier and Type | Field and Description |
---|---|
protected Host |
host
host field
|
protected int |
port
port field
|
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation
Constructor and Description |
---|
HostPort()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this object.
|
String |
encode()
Encode this hostport into its string representation.
|
StringBuilder |
encode(StringBuilder buffer)
Put the encoded version of this object in the given StringBuilder.
|
boolean |
equals(Object other)
returns true if the two objects are equals, false otherwise.
|
Host |
getHost()
get the Host field
|
InetAddress |
getInetAddress()
Return the internet address corresponding to the host.
|
int |
getPort()
get the port field
|
int |
hashCode() |
boolean |
hasPort()
Returns boolean value indicating if Header has port
|
void |
merge(Object mergeObject)
Recursively override the fields of this object with the fields
of a new object.
|
void |
removePort()
remove port.
|
void |
setHost(Host h)
Set the host member
|
void |
setPort(int p)
Set the port member
|
String |
toString() |
dbgPrint, dbgPrint, debugDump, debugDump, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, match, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint
protected Host host
protected int port
public String encode()
encode
in class GenericObject
public StringBuilder encode(StringBuilder buffer)
GenericObject
encode
in class GenericObject
public boolean equals(Object other)
equals
in class GenericObject
other
- Object to setpublic Host getHost()
public int getPort()
public boolean hasPort()
public void removePort()
public void setHost(Host h)
h
- Host to setpublic void setPort(int p)
p
- int to setpublic InetAddress getInetAddress() throws UnknownHostException
java.net.UnkownHostException
- if host name cannot be resolved.UnknownHostException
public void merge(Object mergeObject)
GenericObject
merge
in class GenericObject
mergeObject
- is the replacement object. The override
obect must be of the same class as this object.
Set any fields that you do not want to override as null in the
mergeOject object.public Object clone()
GenericObject
clone
in class GenericObject
Copyright © 2018. All Rights Reserved.