Skip to content

Commit cfb53e8

Browse files
author
Quintin Willison
committed
Remove redundant modifiers from interfaces.
1 parent 964c783 commit cfb53e8

14 files changed

Lines changed: 49 additions & 49 deletions

File tree

lib/src/main/java/io/ably/lib/http/Http.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void run() {
7171
}
7272

7373
public interface Execute<Result> {
74-
public void execute(HttpScheduler http, Callback<Result> callback) throws AblyException;
74+
void execute(HttpScheduler http, Callback<Result> callback) throws AblyException;
7575
}
7676

7777
private static class SyncExecuteResult<Result> {

lib/src/main/java/io/ably/lib/realtime/ChannelStateListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
*/
88
public interface ChannelStateListener {
99

10-
public void onChannelStateChanged(ChannelStateChange stateChange);
10+
void onChannelStateChanged(ChannelStateChange stateChange);
1111

1212
/**
1313
* Channel state change. See Ably Realtime API documentation for more details.
1414
*/
15-
public class ChannelStateChange {
15+
class ChannelStateChange {
1616
final public ChannelEvent event;
1717
/* (TH2) The ChannelStateChange object contains the current state in
1818
* attribute current, the previous state in attribute previous. */

lib/src/main/java/io/ably/lib/realtime/CompletionListener.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ public interface CompletionListener {
1212
/**
1313
* Called when the associated operation completes successfully,
1414
*/
15-
public void onSuccess();
15+
void onSuccess();
1616

1717
/**
1818
* Called when the associated operation completes with an error.
1919
* @param reason: information about the error.
2020
*/
21-
public void onError(ErrorInfo reason);
21+
void onError(ErrorInfo reason);
2222

2323
/**
2424
* A Multicaster instance is used in the Ably library to manage a list
2525
* of client listeners against certain operations.
2626
*/
27-
public static class Multicaster extends io.ably.lib.util.Multicaster<CompletionListener> implements CompletionListener {
27+
class Multicaster extends io.ably.lib.util.Multicaster<CompletionListener> implements CompletionListener {
2828
public Multicaster(CompletionListener... members) { super(members); }
2929

3030
@Override
@@ -44,7 +44,7 @@ public void onError(ErrorInfo reason) {
4444
}
4545
}
4646

47-
public static class ToCallback implements Callback<Void> {
47+
class ToCallback implements Callback<Void> {
4848
private CompletionListener listener;
4949
public ToCallback(CompletionListener listener) {
5050
this.listener = listener;
@@ -61,7 +61,7 @@ public void onError(ErrorInfo reason) {
6161
}
6262
}
6363

64-
public static class FromCallback implements CompletionListener {
64+
class FromCallback implements CompletionListener {
6565
private final Callback<Void> callback;
6666

6767
public FromCallback(Callback<Void> callback) {

lib/src/main/java/io/ably/lib/realtime/ConnectionStateListener.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
public interface ConnectionStateListener {
66

7-
public void onConnectionStateChanged(ConnectionStateListener.ConnectionStateChange state);
7+
void onConnectionStateChanged(ConnectionStateListener.ConnectionStateChange state);
88

9-
public static class ConnectionStateChange {
9+
class ConnectionStateChange {
1010
public final ConnectionEvent event;
1111
public final ConnectionState previous;
1212
public final ConnectionState current;
1313
public final long retryIn;
1414
public final ErrorInfo reason;
15-
15+
1616
public ConnectionStateChange(ConnectionState previous, ConnectionState current, long retryIn, ErrorInfo reason) {
1717
this.event = current.getConnectionEvent();
1818
this.previous = previous;
@@ -35,7 +35,7 @@ public static ConnectionStateChange createUpdateEvent(ErrorInfo reason) {
3535
}
3636
}
3737

38-
static class Multicaster extends io.ably.lib.util.Multicaster<ConnectionStateListener> implements ConnectionStateListener {
38+
class Multicaster extends io.ably.lib.util.Multicaster<ConnectionStateListener> implements ConnectionStateListener {
3939
@Override
4040
public void onConnectionStateChanged(ConnectionStateChange state) {
4141
for(ConnectionStateListener member : members)
@@ -45,7 +45,7 @@ public void onConnectionStateChanged(ConnectionStateChange state) {
4545
}
4646
}
4747

48-
static class Filter implements ConnectionStateListener {
48+
class Filter implements ConnectionStateListener {
4949
@Override
5050
public void onConnectionStateChanged(ConnectionStateChange change) {
5151
if(change.current == state)
@@ -55,4 +55,4 @@ public void onConnectionStateChanged(ConnectionStateChange change) {
5555
ConnectionState state;
5656
ConnectionStateListener listener;
5757
}
58-
}
58+
}

lib/src/main/java/io/ably/lib/rest/Auth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ public boolean equals(Object obj) {
471471
* or signed token requests, in response to a request with given token params.
472472
*/
473473
public interface TokenCallback {
474-
public Object getTokenRequest(TokenParams params) throws AblyException;
474+
Object getTokenRequest(TokenParams params) throws AblyException;
475475
}
476476

477477
/**

lib/src/main/java/io/ably/lib/transport/ITransport.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818

1919
public interface ITransport {
2020

21-
public static final String TAG = ITransport.class.getName();
21+
String TAG = ITransport.class.getName();
2222

23-
public interface Factory {
23+
interface Factory {
2424
/**
2525
* Obtain and instance of this transport based on the specified options.
2626
*/
27-
public ITransport getTransport(TransportParams transportParams, ConnectionManager connectionManager);
27+
ITransport getTransport(TransportParams transportParams, ConnectionManager connectionManager);
2828
}
2929

30-
public enum Mode {
30+
enum Mode {
3131
clean,
3232
resume,
3333
recover
3434
}
3535

36-
public static class TransportParams {
36+
class TransportParams {
3737
protected ClientOptions options;
3838
protected String host;
3939
protected int port;
@@ -95,36 +95,36 @@ public Param[] getConnectParams(Param[] baseParams) {
9595
}
9696
}
9797

98-
public static interface ConnectListener {
99-
public void onTransportAvailable(ITransport transport);
100-
public void onTransportUnavailable(ITransport transport, ErrorInfo reason);
98+
interface ConnectListener {
99+
void onTransportAvailable(ITransport transport);
100+
void onTransportUnavailable(ITransport transport, ErrorInfo reason);
101101
}
102102

103103
/**
104104
* Initiate a connection attempt; the transport will be activated,
105105
* and attempt to remain connected, until disconnect() is called.
106-
* @throws AblyException
106+
* @throws AblyException
107107
*/
108-
public void connect(ConnectListener connectListener);
108+
void connect(ConnectListener connectListener);
109109

110110
/**
111111
* Close this transport.
112112
*/
113-
public void close();
113+
void close();
114114

115115
/**
116116
* Send a message on the channel
117117
* @param msg
118118
* @throws IOException
119119
*/
120-
public void send(ProtocolMessage msg) throws AblyException;
120+
void send(ProtocolMessage msg) throws AblyException;
121121

122122
/**
123123
* Get connection URL
124124
* @return
125125
*/
126-
public String getURL();
126+
String getURL();
127127

128-
public String getHost();
128+
String getHost();
129129

130130
}

lib/src/main/java/io/ably/lib/transport/NetworkConnectivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
public abstract class NetworkConnectivity {
99

1010
public interface NetworkConnectivityListener {
11-
public void onNetworkAvailable();
12-
public void onNetworkUnavailable(ErrorInfo reason);
11+
void onNetworkAvailable();
12+
void onNetworkUnavailable(ErrorInfo reason);
1313
}
1414

1515
public void addListener(NetworkConnectivityListener listener) {

lib/src/main/java/io/ably/lib/types/AsyncHttpPaginatedResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public interface Callback {
3333
/**
3434
* Called when the associated request completes with an Http response,
3535
*/
36-
public void onResponse(AsyncHttpPaginatedResponse response);
36+
void onResponse(AsyncHttpPaginatedResponse response);
3737

3838
/**
3939
* Called when the associated operation completes with an error.
4040
* @param reason: information about the error.
4141
*/
42-
public void onError(ErrorInfo reason);
42+
void onError(ErrorInfo reason);
4343
}
4444
}

lib/src/main/java/io/ably/lib/types/AsyncPaginatedResult.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ public interface AsyncPaginatedResult<T> {
1212
/**
1313
* Get the contents as an array of component type
1414
*/
15-
public T[] items();
15+
T[] items();
1616

1717
/**
1818
* Obtain params required to perform the given relative query
1919
*/
20-
public abstract void first(Callback<AsyncPaginatedResult<T>> callback);
21-
public abstract void current(Callback<AsyncPaginatedResult<T>> callback);
22-
public abstract void next(Callback<AsyncPaginatedResult<T>> callback);
20+
void first(Callback<AsyncPaginatedResult<T>> callback);
21+
void current(Callback<AsyncPaginatedResult<T>> callback);
22+
void next(Callback<AsyncPaginatedResult<T>> callback);
2323

24-
public abstract boolean hasFirst();
25-
public abstract boolean hasCurrent();
26-
public abstract boolean hasNext();
24+
boolean hasFirst();
25+
boolean hasCurrent();
26+
boolean hasNext();
2727
}

lib/src/main/java/io/ably/lib/types/Callback.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ public interface Callback<T> {
1010
/**
1111
* Called when the associated operation completes successfully,
1212
*/
13-
public void onSuccess(T result);
13+
void onSuccess(T result);
1414

1515
/**
1616
* Called when the associated operation completes with an error.
1717
* @param reason: information about the error.
1818
*/
19-
public void onError(ErrorInfo reason);
19+
void onError(ErrorInfo reason);
2020

21-
public abstract static class Map<T, U> implements Callback<T> {
21+
abstract class Map<T, U> implements Callback<T> {
2222
private final Callback<U> callback;
2323

2424
public abstract U map(T result);

0 commit comments

Comments
 (0)