C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
ProportionalExpense.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 ProportionalExpense : Fee, IEquatable<ProportionalExpense>
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
21 #region Equality Overrides
23 public bool Equals(ProportionalExpense other) => ReferenceEquals(this, other) ||
24 other != null &&
25 base.Equals((Fee)other) &&
26 rate.Equals(other.rate) &&
27 ReferencesEquivalent(premiums, other.premiums);
28
30 public override bool Equals(object obj) =>
31 obj is ProportionalExpense proportionalExpense && Equals(proportionalExpense);
32
34 public override int GetHashCode()
35 {
36 int hash = base.GetHashCode();
37 hash += 23 * HashReferences(premiums);
38 hash += 23 * rate.GetHashCode();
39 return hash;
40 }
41 #endregion Equality Overrides
42 }
43}
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 Proportional Expense applies a fee that is the rate multiplied by the sum of premium sources.
bool Equals(ProportionalExpense other)
List< FeeReference > premiums
The premium sources.
override bool Equals(object obj)
double rate
The proportional rate.