frostfs-sdk-csharp/src/FrostFS.SDK.ClientV2/Models/Netmap/FrostFsVersion.cs
Pavel Gross d1271df207
All checks were successful
DCO / DCO (pull_request) Successful in 35s
[#13] Client: Use code analyzers
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-09-23 19:25:59 +03:00

36 lines
No EOL
722 B
C#

using FrostFS.Refs;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK;
public class FrostFsVersion(int major, int minor)
{
private Version? version;
public int Major { get; set; } = major;
public int Minor { get; set; } = minor;
internal Version Version
{
get
{
this.version ??= this.ToMessage();
return this.version;
}
}
public bool IsSupported(FrostFsVersion version)
{
if (version is null)
{
throw new System.ArgumentNullException(nameof(version));
}
return Major == version.Major;
}
public override string ToString()
{
return $"v{Major}.{Minor}";
}
}