Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
95 lines (82 sloc) 4.02 KB
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Quaggan.cs" company="GW2.NET Coding Team">
// This product is licensed under the GNU General Public License version 2 (GPLv2). See the License in the project root folder or the following page: http://www.gnu.org/licenses/gpl-2.0.html
// </copyright>
// <summary>
// Represents a Quaggan.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace GW2NET.Quaggans
{
using System;
/// <summary>Represents a Quaggan.</summary>
public class Quaggan : IEquatable<Quaggan>
{
/// <summary>Gets or sets the Quaggan identifier.</summary>
public string Id { get; set; }
/// <summary>Gets or sets the resource location.</summary>
public Uri Url { get; set; }
/// <summary>Indicates whether an object is equal to another object of the same type.</summary>
/// <param name="left">The object on the left side.</param>
/// <param name="right">The object on the right side.</param>
/// <returns>true if the <paramref name="left" /> parameter is equal to the <paramref name="right" /> parameter; otherwise, false.</returns>
public static bool operator ==(Quaggan left, Quaggan right)
{
return object.Equals(left, right);
}
/// <summary>Indicates whether an object differs from another object of the same type.</summary>
/// <param name="left">The object on the left side.</param>
/// <param name="right">The object on the right side.</param>
/// <returns>true if the <paramref name="left" /> parameter differs from the <paramref name="right" /> parameter; otherwise, false.</returns>
public static bool operator !=(Quaggan left, Quaggan right)
{
return !object.Equals(left, right);
}
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
/// <param name="other">An object to compare with this object.</param>
public bool Equals(Quaggan other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
return string.Equals(this.Id, other.Id);
}
/// <summary>Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.</summary>
/// <returns>true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.</returns>
/// <param name="obj">The object to compare with the current object. </param>
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((Quaggan)obj);
}
/// <summary>Serves as a hash function for a particular type.</summary>
/// <returns>A hash code for the current <see cref="T:System.Object"/>.</returns>
public override int GetHashCode()
{
return this.Id != null ? this.Id.GetHashCode() : 0;
}
/// <summary>Returns a string that represents the current object.</summary>
/// <returns>A string that represents the current object.</returns>
public override string ToString()
{
return this.Id ?? base.ToString();
}
}
}
You can’t perform that action at this time.