36 lines
986 B
C#
36 lines
986 B
C#
namespace FrostFS.SDK.Client;
|
|
|
|
public readonly struct ObjectPartInfo(long offset, int length, FrostFsObjectId objectId) : System.IEquatable<ObjectPartInfo>
|
|
{
|
|
public long Offset { get; } = offset;
|
|
public int Length { get; } = length;
|
|
public FrostFsObjectId ObjectId { get; } = objectId;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj == null || obj is not ObjectPartInfo)
|
|
return false;
|
|
|
|
return Equals((ObjectPartInfo)obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return ((int)(Offset >> 32)) ^ (int)Offset ^ Length ^ ObjectId.Value.GetHashCode();
|
|
}
|
|
|
|
public static bool operator ==(ObjectPartInfo left, ObjectPartInfo right)
|
|
{
|
|
return left.Equals(right);
|
|
}
|
|
|
|
public static bool operator !=(ObjectPartInfo left, ObjectPartInfo right)
|
|
{
|
|
return !(left == right);
|
|
}
|
|
|
|
public bool Equals(ObjectPartInfo other)
|
|
{
|
|
return GetHashCode() == other.GetHashCode();
|
|
}
|
|
}
|