All checks were successful
DCO / DCO (pull_request) Successful in 35s
Signed-off-by: Pavel Gross <p.gross@yadro.com>
36 lines
No EOL
722 B
C#
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}";
|
|
}
|
|
} |