44//
55// SPDX-License-Identifier: BSD-3-Clause
66
7+ import "package:meta/meta.dart" ;
8+
79import "../../scripting_api/discovery/thing_filter.dart" ;
810
911/// Used to indicate whether the discovery mechanism will be used to discover
@@ -89,13 +91,16 @@ enum ProtocolType {
8991
9092/// A configuration that is used by the `WoT.discover()` method when registered
9193/// with the underlying `Servient` .
92- sealed class DiscoveryConfiguration {}
94+ @immutable
95+ sealed class DiscoveryConfiguration {
96+ const DiscoveryConfiguration ();
97+ }
9398
9499/// A configuration used for direct discovery, i.e. the direct retrieval of a
95100/// Thing Description from a [uri] .
96101final class DirectConfiguration extends DiscoveryConfiguration {
97102 /// Instantiates a new [DirectConfiguration] object from a [uri] .
98- DirectConfiguration (this .uri);
103+ const DirectConfiguration (this .uri);
99104
100105 /// The [Uri] the Thing Description can be retrieved from.
101106 final Uri uri;
@@ -111,7 +116,7 @@ final class ExploreDirectoryConfiguration extends DiscoveryConfiguration {
111116 ///
112117 /// A [thingFilter] can be provided for filtering and the total number of TDs
113118 /// can be [limit] ed.
114- ExploreDirectoryConfiguration (
119+ const ExploreDirectoryConfiguration (
115120 this .uri, {
116121 this .thingFilter,
117122 this .limit,
@@ -141,7 +146,7 @@ final class ExploreDirectoryConfiguration extends DiscoveryConfiguration {
141146/// (exploration phase).
142147sealed class TwoStepConfiguration extends DiscoveryConfiguration {
143148 /// Creates a new [TwoStepConfiguration] object from a [discoveryType] .
144- TwoStepConfiguration ({required this .discoveryType});
149+ const TwoStepConfiguration ({required this .discoveryType});
145150
146151 /// Indicates whether this configuration is used for discovering Things or
147152 /// Thing Description Directories.
@@ -161,7 +166,7 @@ final class DnsSdDConfiguration extends TwoStepConfiguration {
161166 /// Other domain names are currently unsupported.
162167 ///
163168 /// [RFC 6762] : https://datatracker.ietf.org/doc/html/rfc6762
164- DnsSdDConfiguration ({
169+ const DnsSdDConfiguration ({
165170 this .domainName = ".local" ,
166171 super .discoveryType = DiscoveryType .thing,
167172 this .protocolType = ProtocolType .tcp,
0 commit comments