mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Add topic filter builder
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
using MQTTnet.Core.Protocol;
|
||||
|
||||
namespace MQTTnet.Core.Packets
|
||||
{
|
||||
public sealed class TopicFilter
|
||||
{
|
||||
public TopicFilter(string topic, MqttQualityOfServiceLevel qualityOfServiceLevel)
|
||||
{
|
||||
Topic = topic;
|
||||
QualityOfServiceLevel = qualityOfServiceLevel;
|
||||
}
|
||||
|
||||
public string Topic { get; }
|
||||
|
||||
public MqttQualityOfServiceLevel QualityOfServiceLevel { get; }
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return QualityOfServiceLevel.GetHashCode() ^ (Topic ?? string.Empty).GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Topic + "@" + QualityOfServiceLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user