Skip to content

Commit ab72584

Browse files
Removed Guava Optional and added @nonnull annotations
Change-Id: I1f62f00f140b03d758a060ac6387c50726aedfb7
1 parent 3990264 commit ab72584

9 files changed

Lines changed: 116 additions & 423 deletions

File tree

websockets-example/src/main/java/com/appunite/socket/Main.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import com.appunite.websocket.WebSocketListener;
3535
import com.appunite.websocket.WrongWebsocketResponse;
3636

37+
import javax.annotation.Nonnull;
38+
3739
public class Main extends Activity implements OnClickListener {
3840

3941

@@ -70,7 +72,7 @@ public void run() {
7072
}
7173

7274
@Override
73-
public void onStringMessage(final String message) throws IOException, InterruptedException, NotConnectedException {
75+
public void onStringMessage(@Nonnull final String message) throws IOException, InterruptedException, NotConnectedException {
7476
runOnUiThread(new Runnable() {
7577

7678
@Override
@@ -81,7 +83,7 @@ public void run() {
8183
}
8284

8385
@Override
84-
public void onBinaryMessage(byte[] data) throws IOException, InterruptedException, NotConnectedException {
86+
public void onBinaryMessage(@Nonnull byte[] data) throws IOException, InterruptedException, NotConnectedException {
8587
runOnUiThread(new Runnable() {
8688

8789
@Override
@@ -92,7 +94,7 @@ public void run() {
9294
}
9395

9496
@Override
95-
public void onPing(byte[] data) throws IOException, InterruptedException, NotConnectedException {
97+
public void onPing(@Nonnull byte[] data) throws IOException, InterruptedException, NotConnectedException {
9698
runOnUiThread(new Runnable() {
9799

98100
@Override
@@ -103,7 +105,7 @@ public void run() {
103105
}
104106

105107
@Override
106-
public void onPong(byte[] data) throws IOException, InterruptedException, NotConnectedException {
108+
public void onPong(@Nonnull byte[] data) throws IOException, InterruptedException, NotConnectedException {
107109
runOnUiThread(new Runnable() {
108110

109111
@Override
@@ -114,7 +116,7 @@ public void run() {
114116
}
115117

116118
@Override
117-
public void onServerRequestedClose(byte[] data) throws IOException, InterruptedException, NotConnectedException {
119+
public void onServerRequestedClose(@Nonnull byte[] data) throws IOException, InterruptedException, NotConnectedException {
118120
runOnUiThread(new Runnable() {
119121

120122
@Override
@@ -125,7 +127,7 @@ public void run() {
125127
}
126128

127129
@Override
128-
public void onUnknownMessage(byte[] data) throws IOException, InterruptedException, NotConnectedException {
130+
public void onUnknownMessage(@Nonnull byte[] data) throws IOException, InterruptedException, NotConnectedException {
129131
runOnUiThread(new Runnable() {
130132

131133
@Override

0 commit comments

Comments
 (0)