public class ByondMessage extends Object
Container for message, which will be sent to BYOND server.
Message must contain question mark in the beginning of string, but it could be omitted,
because it will be added on send process automatically if missing. So "ping" and "?ping" will have the same result.
Also, message itself is like a parameters for HTTP request, so multiple messages in one send is possible.
To do it all params should be divided with ";" or "&" marks.
For example: "ping&data=123&status
".
Expected response type checked on response validation process. If real response doesn't match,
exception UnexpectedResponseException
will be thrown.
Default expected response is ResponseType.ANY
.
Constructor and Description |
---|
ByondMessage() |
ByondMessage(ServerAddress serverAddress,
String message) |
ByondMessage(ServerAddress serverAddress,
String message,
ResponseType expectedResponse) |
ByondMessage(String serverName,
int serverPort,
String message) |
ByondMessage(String serverName,
int serverPort,
String message,
ResponseType expectedResponse) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
ResponseType |
getExpectedResponse() |
String |
getMessage() |
String |
getMessageAsTopic()
Checks if message has question mark in the beginning, and, if it isn't,
adds it and return new string, so message in 'this' instance doesn't touched.
|
ServerAddress |
getServerAddress() |
int |
hashCode() |
void |
setExpectedResponse(ResponseType expectedResponse) |
void |
setMessage(String message) |
void |
setServerAddress(ServerAddress serverAddress) |
String |
toString() |
public ByondMessage(ServerAddress serverAddress, String message)
public ByondMessage(ServerAddress serverAddress, String message, ResponseType expectedResponse)
public ByondMessage(String serverName, int serverPort, String message, ResponseType expectedResponse)
public ByondMessage()
public String getMessageAsTopic()
public ServerAddress getServerAddress()
public String getMessage()
public ResponseType getExpectedResponse()
public void setServerAddress(ServerAddress serverAddress)
public void setMessage(String message)
public void setExpectedResponse(ResponseType expectedResponse)
protected boolean canEqual(Object other)
Copyright © 2018. All rights reserved.