Skip to content

Commit

Permalink
chore!: use new class keywords for protocol interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed May 13, 2023
1 parent 7ff9916 commit 5ef5148
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ coap.PskCredentialsCallback? _createPskCallback(
}

/// A [ProtocolClient] for the Constrained Application Protocol (CoAP).
class CoapClient extends ProtocolClient {
final class CoapClient implements ProtocolClient {
/// Creates a new [CoapClient] based on an optional [CoapConfig].
CoapClient([this._coapConfig, this._clientSecurityProvider]);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_coap/coap_client_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'coap_client.dart';
import 'coap_config.dart';

/// A [ProtocolClientFactory] that produces CoAP clients.
class CoapClientFactory extends ProtocolClientFactory {
final class CoapClientFactory implements ProtocolClientFactory {
/// Creates a new [CoapClientFactory] based on an optional [CoapConfig].
CoapClientFactory([this.coapConfig]);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_coap/coap_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../scripting_api/exposed_thing.dart';
import 'coap_config.dart';

/// A [ProtocolServer] for the Constrained Application Protocol (CoAP).
class CoapServer extends ProtocolServer {
final class CoapServer implements ProtocolServer {
/// Creates a new [CoapServer] which can be configured using a [CoapConfig].
CoapServer([CoapConfig? coapConfig])
: port = coapConfig?.port ?? 5683,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_http/http_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const _authorizationHeader = 'Authorization';
/// [RFC 7616]: https://datatracker.ietf.org/doc/html/rfc7616
/// [RFC 6750]: https://datatracker.ietf.org/doc/html/rfc6750
/// [`ComboSecurityScheme`]: https://w3c.github.io/wot-thing-description/#combosecurityscheme
class HttpClient extends ProtocolClient {
final class HttpClient implements ProtocolClient {
/// Creates a new [HttpClient].
HttpClient(this._clientSecurityProvider);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_http/http_client_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'http_client.dart';
import 'http_config.dart';

/// A [ProtocolClientFactory] that produces HTTP and HTTPS clients.
class HttpClientFactory extends ProtocolClientFactory {
final class HttpClientFactory implements ProtocolClientFactory {
/// Creates a new [HttpClientFactory] based on an optional [HttpConfig].
HttpClientFactory([this.httpConfig]);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_http/http_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../scripting_api/exposed_thing.dart';
import 'http_config.dart';

/// A [ProtocolServer] for the Hypertext Transfer Protocol (HTTP).
class HttpServer extends ProtocolServer {
final class HttpServer implements ProtocolServer {
/// Create a new [HttpServer] from an optional [HttpConfig].
HttpServer(HttpConfig? httpConfig)
// TODO(JKRhb): Check if the scheme should be determined differently.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_mqtt/mqtt_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import 'mqtt_subscription.dart';
/// [ProtocolClient] for supporting the MQTT protocol.
///
/// Currently, only MQTT version 3.1.1 is supported.
class MqttClient extends ProtocolClient {
final class MqttClient implements ProtocolClient {
/// Constructor.
MqttClient(
this._clientSecurityProvider,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/binding_mqtt/mqtt_client_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'mqtt_client.dart';
import 'mqtt_config.dart';

/// [ProtocolClientFactory] for creating [MqttClient]s.
class MqttClientFactory extends ProtocolClientFactory {
final class MqttClientFactory implements ProtocolClientFactory {
@override
ProtocolClient createClient([
ClientSecurityProvider? clientSecurityProvider,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/credentials/credentials.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// SPDX-License-Identifier: BSD-3-Clause

/// Base class used for defining credentials for Thing Interactions.
base class Credentials {}
abstract base class Credentials {}
2 changes: 1 addition & 1 deletion lib/src/core/protocol_interfaces/protocol_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../../scripting_api/subscription.dart';
import '../content.dart';

/// Base class for a Protocol Client.
abstract class ProtocolClient {
abstract interface class ProtocolClient {
/// Starts this [ProtocolClient].
Future<void> start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../security_provider.dart';
import 'protocol_client.dart';

/// Base class for a factory that produces [ProtocolClient]s.
abstract class ProtocolClientFactory {
abstract interface class ProtocolClientFactory {
/// The protocol [schemes] support of the clients this factory produces.
Set<String> get schemes;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/protocol_interfaces/protocol_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../../../scripting_api.dart';
import '../security_provider.dart';

/// Base class for a Protocol Server.
abstract class ProtocolServer {
abstract interface class ProtocolServer {
/// The [port] number used by this Server.
int get port;

Expand Down

0 comments on commit 5ef5148

Please sign in to comment.