[#58] Observable client cut
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
5f451c8818
commit
c88eea1f82
7 changed files with 328 additions and 56 deletions
38
src/FrostFS.SDK.Client/Models/Object/UploadInfo.cs
Normal file
38
src/FrostFS.SDK.Client/Models/Object/UploadInfo.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using FrostFS.SDK;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue