Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Bugs fixed #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 56 additions & 23 deletions src/Kafka/Kafka.Client/Common/ClientIdAndBroker.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,57 @@
namespace Kafka.Client.Common
{
/// <summary>
/// Convenience case class since (clientId, brokerInfo) pairs are used to create
/// SyncProducer Request Stats and SimpleConsumer Request and Response Stats.
/// </summary>
public class ClientIdAndBroker
{
public string ClientId { get; private set; }

public string BrokerInfo { get; private set; }

public ClientIdAndBroker(string clientId, string brokerInfo)
{
this.ClientId = clientId;
this.BrokerInfo = brokerInfo;
}

public override string ToString()
{
return string.Format("{0}-{1}", this.ClientId, this.BrokerInfo);
}
}
namespace Kafka.Client.Common
{
/// <summary>
/// Convenience case class since (clientId, brokerInfo) pairs are used to create
/// SyncProducer Request Stats and SimpleConsumer Request and Response Stats.
/// </summary>
public class ClientIdAndBroker
{
public string ClientId { get; private set; }

public string BrokerInfo { get; private set; }

public ClientIdAndBroker(string clientId, string brokerInfo)
{
this.ClientId = clientId;
this.BrokerInfo = brokerInfo;
}

public override string ToString()
{
return string.Format("{0}-{1}", this.ClientId, this.BrokerInfo);
}

protected bool Equals(ClientIdAndBroker other)
{
return this.ClientId == other.ClientId && this.BrokerInfo == other.BrokerInfo;
}

public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}

if (ReferenceEquals(this, obj))
{
return true;
}

if (obj.GetType() != this.GetType())
{
return false;
}

return this.Equals((ClientIdAndBroker)obj);
}

public override int GetHashCode()
{
unchecked
{
return ((this.ClientId != null ? this.ClientId.GetHashCode() : 0) * 397) ^ (this.BrokerInfo != null ? this.BrokerInfo.GetHashCode() : 0);
}
}
}
}
Loading