Skip to content

Commit

Permalink
Merge pull request #46 from vanniktech/final
Browse files Browse the repository at this point in the history
Apply final on Events, Exceptions and Predicates.
  • Loading branch information
IvBaranov authored Oct 29, 2018
2 parents 007644c + f08cad8 commit 782e3de
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* {@link BluetoothDevice#ACTION_ACL_DISCONNECT_REQUESTED},
* {@link BluetoothDevice#ACTION_ACL_DISCONNECTED}
*/
public class AclEvent {
public final class AclEvent {

private String action;
private BluetoothDevice bluetoothDevice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* {@link BluetoothDevice#BOND_BONDING},
* {@link BluetoothDevice#BOND_BONDED}
*/
public class BondStateEvent {
public final class BondStateEvent {

private int state;
private int previousState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* {@link BluetoothAdapter#STATE_CONNECTED},
* {@link BluetoothAdapter#STATE_DISCONNECTING}
*/
public class ConnectionStateEvent {
public final class ConnectionStateEvent {

private int state;
private int previousState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* disconnected), profile type and {@link BluetoothProfile}. When service state is {@link
* State#DISCONNECTED} the bluetoothProfile is null.
*/
public class ServiceEvent {
public final class ServiceEvent {

public enum State {
CONNECTED, DISCONNECTED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.io.IOException;

public class ConnectionClosedException extends IOException {
public final class ConnectionClosedException extends IOException {

public ConnectionClosedException() {
super("Connection is closed.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Thrown when {@link BluetoothAdapter#getProfileProxy} returns true, which means that connection
* to bluetooth profile failed.
*/
public class GetProfileProxyException extends RuntimeException {
public final class GetProfileProxyException extends RuntimeException {

public GetProfileProxyException() {
super("Failed to get profile proxy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
* Class that contains predicates for filtering bluetooth states, actions and other indicators
* received from {@link BroadcastReceiver}.
*/
public class BtPredicate {

public final class BtPredicate {
/**
* Function, which checks if current object equals single argument or one of many
* arguments. It can be used inside filter(...) method from RxJava.
Expand All @@ -43,4 +42,8 @@ public static <T> Predicate<T> in(final T... arguments) {
}
};
}

private BtPredicate() {
throw new AssertionError("No instances.");
}
}

0 comments on commit 782e3de

Please sign in to comment.