[#30] Client: Add object model for Rules, fix for comments
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
cdad8ad3a8
commit
13da97520d
1 changed files with 14 additions and 5 deletions
|
@ -88,17 +88,26 @@ internal static class RuleSerializer
|
|||
return Int64Size(len) + len;
|
||||
}
|
||||
|
||||
private static int ActionsSize(Actions? action)
|
||||
private static int ActionsSize(Actions action)
|
||||
{
|
||||
return BoolSize // Inverted
|
||||
+ (action != null ? SliceSize(action.Names, StringSize) : 0);
|
||||
if (action is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(action));
|
||||
}
|
||||
|
||||
return BoolSize // Inverted
|
||||
+ SliceSize(action.Names, StringSize);
|
||||
}
|
||||
|
||||
private static int ResourcesSize(Resource? resource)
|
||||
private static int ResourcesSize(Resource resource)
|
||||
{
|
||||
if (resource is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(resource));
|
||||
}
|
||||
|
||||
return BoolSize // Inverted
|
||||
+ (resource != null ? SliceSize(resource.Names, StringSize) : 0);
|
||||
+ SliceSize(resource.Names, StringSize);
|
||||
}
|
||||
|
||||
private static int ConditionSize(Condition condition)
|
||||
|
|
Loading…
Add table
Reference in a new issue