export class ConnectionInfo {
  readonly host: string;
  readonly port: number;
  readonly username: string;

  constructor(params: { host: string; port: number; username: string }) {
    this.host = params.host;
    this.port = params.port;
    this.username = params.username;
  }

  toString(): string {
    return `${this.username}@${this.host}:${this.port}`;
  }

  equals(other: ConnectionInfo): boolean {
    return (
      this.host === other.host &&
      this.port === other.port &&
      this.username === other.username
    );
  }
}
