[#34] Client: Add rules deserialization
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
bd8eb7cc60
commit
8835b23ed3
18 changed files with 426 additions and 52 deletions
|
@ -1,6 +1,6 @@
|
|||
namespace FrostFS.SDK.Client;
|
||||
|
||||
public struct Resource(bool inverted, string[] names) : System.IEquatable<Resource>
|
||||
public struct Resources(bool inverted, string[] names) : System.IEquatable<Resources>
|
||||
{
|
||||
public bool Inverted { get; set; } = inverted;
|
||||
|
||||
|
@ -8,10 +8,10 @@ public struct Resource(bool inverted, string[] names) : System.IEquatable<Resour
|
|||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || obj is not Resource)
|
||||
if (obj == null || obj is not Resources)
|
||||
return false;
|
||||
|
||||
return Equals((Resource)obj);
|
||||
return Equals((Resources)obj);
|
||||
}
|
||||
|
||||
public override readonly int GetHashCode()
|
||||
|
@ -19,17 +19,17 @@ public struct Resource(bool inverted, string[] names) : System.IEquatable<Resour
|
|||
return Inverted.GetHashCode() ^ string.Join(string.Empty, Names).GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(Resource left, Resource right)
|
||||
public static bool operator ==(Resources left, Resources right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(Resource left, Resource right)
|
||||
public static bool operator !=(Resources left, Resources right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
public readonly bool Equals(Resource other)
|
||||
public readonly bool Equals(Resources other)
|
||||
{
|
||||
return this.GetHashCode().Equals(other.GetHashCode());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue