View Javadoc
1   package org.oxerr.huobi.websocket.dto.request;
2   
3   import org.apache.commons.lang3.builder.ToStringBuilder;
4   import org.oxerr.huobi.websocket.HuobiSocket;
5   
6   /**
7    * The request for {@link HuobiSocket}.
8    */
9   public class Request {
10  
11  	private final int version;
12  	private final String msgType;
13  	private long requestIndex;
14  
15  	/**
16  	 * Constructs a request.
17  	 *
18  	 * @param version
19  	 *            Client version.
20  	 * @param msgType
21  	 *            Message type.
22  	 */
23  	public Request(int version, String msgType) {
24  		this.version = version;
25  		this.msgType = msgType;
26  	}
27  
28  	/**
29  	 * Returns the serial number to sort multiple requests, the server side will
30  	 * echo back the consistent data that client posted.
31  	 *
32  	 * @return serial number.
33  	 */
34  	public long getRequestIndex() {
35  		return requestIndex;
36  	}
37  
38  	public void setRequestIndex(long requestIndex) {
39  		this.requestIndex = requestIndex;
40  	}
41  
42  	public int getVersion() {
43  		return version;
44  	}
45  
46  	public String getMsgType() {
47  		return msgType;
48  	}
49  
50  	@Override
51  	public String toString() {
52  		return ToStringBuilder.reflectionToString(this);
53  	}
54  
55  }