Skip to content

Commit 8e1cc26

Browse files
committed
Created this as an object to be passed to a ClientJsonListener
1 parent c0616ff commit 8e1cc26

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package listener_references;
2+
3+
import org.json.JSONObject;
4+
5+
/**
6+
* The {@link ClientJson} object to be passed to a {@link listeners.ClientJsonListener}
7+
*/
8+
public class ClientJson extends JsonImpl {
9+
10+
protected final ClientConnection connection;
11+
12+
/**
13+
* Constructs a new {@link ClientJson}
14+
* @param json the {@link JSONObject}
15+
* @param connection the {@link ClientConnection} the json was received from
16+
*/
17+
public ClientJson(JSONObject json, ClientConnection connection) {
18+
super(json);
19+
this.connection = connection;
20+
}
21+
22+
/**
23+
* @return the {@link ClientConnection} the json was received from
24+
*/
25+
@Override
26+
public ClientConnection getConnection() {
27+
return connection;
28+
}
29+
}

0 commit comments

Comments
 (0)