C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
ProfitCommission.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Runtime.Serialization;
4
5namespace AnalyzeRe.Fees
6{
11 public class ProfitCommission : Fee, IEquatable<ProfitCommission>
12 {
14 [DataMember(Order = 20)]
15 public double rate { get; set; }
16
18 [DataMember(Order = 21)]
19 public List<FeeReference> premiums { get; set; } = new List<FeeReference>();
20
22 [DataMember(Order = 22)]
23 public List<FeeReference> losses { get; set; } = new List<FeeReference>();
24
26 [DataMember(Order = 23)]
27 public List<FeeReference> fees { get; set; } = new List<FeeReference>();
28
29 #region Equality Overrides
31 public bool Equals(ProfitCommission other) => ReferenceEquals(this, other) ||
32 other != null &&
33 base.Equals((Fee)other) &&
34 rate.Equals(other.rate) &&
35 ReferencesEquivalent(premiums, other.premiums) &&
36 ReferencesEquivalent(losses, other.losses) &&
37 ReferencesEquivalent(fees, other.fees);
38
40 public override bool Equals(object obj) =>
41 obj is ProfitCommission profitCommission && Equals(profitCommission);
42
44 public override int GetHashCode()
45 {
46 int hash = base.GetHashCode();
47 hash += 23 * HashReferences(premiums);
48 hash += 23 * HashReferences(losses);
49 hash += 23 * HashReferences(fees);
50 hash += 23 * rate.GetHashCode();
51 return hash;
52 }
53 #endregion Equality Overrides
54 }
55}
Abstract representation of a fee. This resource type cannot be instantiated instead derived resource ...
Definition Fee.cs:14
static bool ReferencesEquivalent(List< FeeReference > first, List< FeeReference > second)
Used to determine if two lists of fee references are equivalent while ignoring the order in which fee...
Definition Fee.cs:63
static int HashReferences(IEnumerable< FeeReference > references)
Get the HashCode for a collection of Fee References.
Definition Fee.cs:52
The Profit Commission applies a fee that is the sum of the premium sources minus the sum of loss and ...
List< FeeReference > premiums
The premium sources.
List< FeeReference > fees
The fee sources.
override bool Equals(object obj)
List< FeeReference > losses
The loss sources.
bool Equals(ProfitCommission other)