frostfs-sdk-csharp/src/FrostFS.SDK.Client/Models/Object/FrostFsSplitInfo.cs
Pavel Gross 9bb7b5eff8 [#28] Clients: Make immutable parameters
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-12-02 19:33:45 +03:00

26 lines
663 B
C#

using FrostFS.Object;
using FrostFS.SDK.Cryptography;
namespace FrostFS.SDK;
public class FrostFsSplitInfo
{
private readonly SplitInfo _splitInfo;
private SplitId? _splitId;
private FrostFsObjectId? _link;
private FrostFsObjectId? _lastPart;
internal FrostFsSplitInfo(SplitInfo splitInfo)
{
_splitInfo = splitInfo;
}
public SplitId SplitId => _splitId ??= new SplitId(_splitInfo.SplitId.ToUuid());
public FrostFsObjectId Link => _link ??= FrostFsObjectId.FromHash(_splitInfo.Link.Value.Span);
public FrostFsObjectId LastPart => _lastPart ??= FrostFsObjectId.FromHash(_splitInfo.LastPart.Value.Span);
}