You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 line
770 B

  1. using MQTTnet.Extensions.Rpc.Options.TopicGeneration;
  2. using System;
  3. namespace MQTTnet.Extensions.Rpc.Options
  4. {
  5. public sealed class MqttRpcClientOptionsBuilder
  6. {
  7. IMqttRpcClientTopicGenerationStrategy _topicGenerationStrategy = new DefaultMqttRpcClientTopicGenerationStrategy();
  8. public MqttRpcClientOptionsBuilder WithTopicGenerationStrategy(IMqttRpcClientTopicGenerationStrategy value)
  9. {
  10. _topicGenerationStrategy = value ?? throw new ArgumentNullException(nameof(value));
  11. return this;
  12. }
  13. public IMqttRpcClientOptions Build()
  14. {
  15. return new MqttRpcClientOptions
  16. {
  17. TopicGenerationStrategy = _topicGenerationStrategy
  18. };
  19. }
  20. }
  21. }