C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.Perspective Class Reference

The loss perspective determines what factors to include when computing a distribution. More...

Public Types

enum  Base {
  LossGross , NetLoss , ReinstatementPremium , ReinstatementBrokerage ,
  Premium , FixedExpense , ProportionalExpense , ProfitCommission ,
  NoClaimsBonus , SlidingScaleCommission , LossNetOfAggregateTerms
}
 The set of available values and RecordTypes that can be used to construct a distribution or metrics result. These can be used on their own, or combined together (with some restrictions enforced by the API). More...
 
enum  Option { Premium , ReinstatementPremium , ReinstatementBrokerage }
 The options to include in the base perspective distribution. More...
 

Public Member Functions

 Perspective (Base perspective_base, IEnumerable< Option > options=null)
 Constructs a legacy perspective string.
 
 Perspective (string perspective)
 Construct a new perspective from a serialized perspective string.
 
override bool Equals (object other)
 Tests object equality.
 
bool Equals (Perspective other)
 Determine whether the two perspectives are equivalent.
 
override int GetHashCode ()
 Serves as a hash function for a particular type.
 
virtual T ShallowCopy< T > ()
 Create a shallow copy of this object.

See also
ExtensionMethods.DeepCopy<T>

for a serializer-based copy method.

 
override string ToString ()
 Perspective string is just the class name.
 

Static Public Member Functions

static Perspective FromEnum (Base perspective)
 Returns the appropriate singleton for the Base perspective given.
 
static Perspective FromEnums (IEnumerable< Base > perspectives)
 Construct a new Perspective that should include the specified Base perspective values.
 
static Perspective FromEnums (params Base[] perspectives)
 Construct a new Perspective that should include the specified Base perspective value or values.
 
static Perspective FromString (string perspectiveString)
 Implicit converter that allows automatically converting a string into a perspective, returning a static singleton instance if appropriate.
 
static string GetStringRepresentation (Perspective persp)
 Generate a string representation of the specified perspective.
 
static Perspective LossNetOf (params Base[] perspectives)
 A convenience static method, similar to the other static singletons, which constructs a complex perspective instance that includes Base.NetLoss as well as one or more additional perspectives.
 
static Perspective LossNetOfAggregateTermsAnd (bool premium=false, bool reinstatement_premium=false, bool reinstatement_brokerage=false)
 Constructs a legacy LossNetOfAggregateTerms[X,Y,Z] perspective, where you can specify which values to include in the loss calculation. Be warned that the legacy perspective Base.LossNetOfAggregateTerms implicitly includes all fee record types.
 
static operator Perspective (Base perspective)
 Implicit converter that converts a Base enum value into a Perspective instance.
 
static implicit operator Perspective (string perspectiveString)
 Implicit converter that allows automatically converting a string into a Perspective instance.
 

Static Public Attributes

static readonly Perspective FixedExpense = new Perspective(Base.FixedExpense)
 Report on the structure's Fees.FixedExpense fees.
 
static readonly Perspective LossGross = new Perspective(Base.LossGross)
 Construct a distribution from the structure's gross losses.
 
static readonly Perspective LossNetOfAggregateTerms = new Perspective(Base.LossNetOfAggregateTerms)
 The legacy perspective value indicating "net loss" - but this includes fee record types as well.
 
static readonly Perspective NetLoss = new Perspective(Base.NetLoss)
 Construct a distribution from the structure's net losses.
 
static readonly Perspective NoClaimsBonus = new Perspective(Base.NoClaimsBonus)
 Report on the structure's Fees.FixedExpense fees.
 
static readonly Perspective Premium = new Perspective(Base.Premium)
 Report on the structure's premium only.
 
static readonly Perspective ProfitCommission = new Perspective(Base.ProfitCommission)
 Report on the structure's Fees.FixedExpense fees.
 
static readonly Perspective ProportionalExpense = new Perspective(Base.ProportionalExpense)
 Report on the structure's Fees.ProportionalExpense fees.
 
static readonly Perspective ReinstatementBrokerage = new Perspective(Base.ReinstatementBrokerage)
 Construct a distribution from the structure's net reinstatement brokerages.
 
static readonly Perspective ReinstatementPremium = new Perspective(Base.ReinstatementPremium)
 Construct a distribution from the structure's net reinstatement premiums.
 
static readonly Perspective SlidingScaleCommission = new Perspective(Base.SlidingScaleCommission)
 Report on the structure's Fees.FixedExpense fees.
 

Protected Member Functions

virtual void AfterMembersCloned (APIType originalResource)
 Invoked following construction if the current instance has been created using a member-wise clone of some other instance. Override if your derived APIType class contains some members that should not be cloned.
 

Detailed Description

The loss perspective determines what factors to include when computing a distribution.

Definition at line 12 of file Perspective.cs.

Inheritance diagram for AnalyzeRe.Perspective:
AnalyzeRe.APIType AnalyzeRe.IAPIType

Member Enumeration Documentation

◆ Base

The set of available values and RecordTypes that can be used to construct a distribution or metrics result. These can be used on their own, or combined together (with some restrictions enforced by the API).

TODO: This enumeration has been defined as Flags, which means we could create a much more performant (for IEquatable implementation) and memory-efficient internal representation than the current string[] array. BUT, to do so would require additional testing and complexity to be able to continue forwards-compatibility support for unrecognized new perspective strings.

Enumerator
LossGross 

Construct a distribution from the structure's gross losses. Note that this perspective uniquely cannot be used in combination with any others.

NetLoss 

Construct a distribution from the structure's net losses.

ReinstatementPremium 

Construct a distribution from the structure's reinstatement premium.

ReinstatementBrokerage 

Construct a distribution from the structure's reinstatement brokerage.

Premium 

Include the fixed premium from layer terms. Note that the server enforces restrictions on when Premium can be included. Generally, it is only supported if the losses have not been otherwise filtered or subdivided (e.g. by peril or reporting period).

FixedExpense 

Include the records generated by Fees.FixedExpense fee structure.

ProportionalExpense 

Include the records generated by Fees.ProportionalExpense fee structure.

ProfitCommission 

Include the records generated by Fees.ProfitCommission fee structure.

NoClaimsBonus 

Include the records generated by NoClaimsBonus structure type.

SlidingScaleCommission 

Include the records generated by "SlidingScaleCommission" structure type.

TODO: SlidingScaleCommission is currently an internal type not surfaced in the C# client.

LossNetOfAggregateTerms 

The legacy perspective value indicating "net loss" - but this includes fee record types as well.

Equivalent to requesting the following combined perspectives: NetLoss,FixedExpense,PropoertionalExpense,ProfitCommission,NoClaimsBonus,SlidingScaleCommission

Definition at line 23 of file Perspective.cs.

◆ Option

The options to include in the base perspective distribution.

Enumerator
Premium 

Subtract fixed premium from the losses.

ReinstatementPremium 

Subtract reinstatement premiums from the losses.

ReinstatementBrokerage 

Add reinstatement brokerages to the losses.

Definition at line 342 of file Perspective.cs.

Constructor & Destructor Documentation

◆ Perspective() [1/2]

AnalyzeRe.Perspective.Perspective ( string  perspective)
inline

Construct a new perspective from a serialized perspective string.

Parameters
perspectiveThe string representation of this perspective. The server expects this to be a comma separated list of Base values.

This string will be relayed to the server exactly as-is; it will not be parsed or validated client-side in any way.

Definition at line 162 of file Perspective.cs.

◆ Perspective() [2/2]

AnalyzeRe.Perspective.Perspective ( Base  perspective_base,
IEnumerable< Option options = null 
)
inline

Constructs a legacy perspective string.

Parameters
perspective_baseThe base perspective to use.
options(Optional) Options to add to the base perspective.

Note that the server supports use of legacy perspectives (LossNetOfAggregateTerms) in a new perspective string format (all comma-separated, no square brackets), so there is no need for us to continue generating the legacy perspective string format. The logic in SplitPerspectiveString guarantees that Perspectives built using the legacy string format will be treated as equivalent to legacy Perspectives build via Base enum values.

Definition at line 173 of file Perspective.cs.

Member Function Documentation

◆ AfterMembersCloned()

virtual void AnalyzeRe.APIType.AfterMembersCloned ( APIType  originalResource)
inlineprotectedvirtualinherited

Invoked following construction if the current instance has been created using a member-wise clone of some other instance. Override if your derived APIType class contains some members that should not be cloned.

Overriding implementations should be sure to invoke base.AfterMembersCloned().

A sane question for a code reviewer to ask might be: "Why not avoid copying those members in the first place?" The answer is that there is no framework-supported method of excluding members from a MemberwiseClone. The only officially supported solution is to not use the object.MemberwiseClone method at all and instead have each class implement it's own Copy method. In our case, most objects have no need to specialize their copy implementation (even though they could - the ShallowCopy<T> method is marked virtual). It's simpler to simply "correct" any special-case members after the fact, and requires less error-prone code than if the code were responsible for ensuring no members were missed in a copy. It's also faster than any reflection-based approach, even though such an approach could benefit from custom attributes meant to exclude certain members from copying.

Reimplemented in AnalyzeRe.APITypes.APIResource_WithDataEndpoint, AnalyzeRe.APIResourceView.BaseAPIResourceView, AnalyzeRe.Distributions.CustomDistribution, AnalyzeRe.LossSets.LossSet_WithData, AnalyzeRe.Optimization.Candidate, AnalyzeRe.Optimization.OptimizationView, and AnalyzeRe.StaticSimulation.

Definition at line 37 of file APIType.cs.

◆ Equals() [1/2]

override bool AnalyzeRe.Perspective.Equals ( object  other)

Tests object equality.

Returns
True if objects are equal
Parameters
otherThe object to compare with the current object.

◆ Equals() [2/2]

bool AnalyzeRe.Perspective.Equals ( Perspective  other)
inline

Determine whether the two perspectives are equivalent.

Returns
True if the two perspectives are equal
Parameters
otherThe perspective to compare to the current one.

Definition at line 314 of file Perspective.cs.

◆ FromEnum()

static Perspective AnalyzeRe.Perspective.FromEnum ( Base  perspective)
inlinestatic

Returns the appropriate singleton for the Base perspective given.

Parameters
perspectiveThe perspective value requested.

Definition at line 207 of file Perspective.cs.

◆ FromEnums() [1/2]

static Perspective AnalyzeRe.Perspective.FromEnums ( IEnumerable< Base perspectives)
static

Construct a new Perspective that should include the specified Base perspective values.

Parameters
perspectivesOne or more perspectives to include.

Returns the a static immutable singleton where possible.

◆ FromEnums() [2/2]

static Perspective AnalyzeRe.Perspective.FromEnums ( params Base[]  perspectives)
static

Construct a new Perspective that should include the specified Base perspective value or values.

Parameters
perspectivesOne or more perspectives to include.

Returns the a static immutable singleton where possible.

◆ FromString()

static Perspective AnalyzeRe.Perspective.FromString ( string  perspectiveString)
inlinestatic

Implicit converter that allows automatically converting a string into a perspective, returning a static singleton instance if appropriate.

Parameters
perspectiveStringThe string representation of the perspective.

Definition at line 246 of file Perspective.cs.

◆ GetHashCode()

override int AnalyzeRe.Perspective.GetHashCode ( )

Serves as a hash function for a particular type.

Returns
A hash code for the current perspective.

◆ GetStringRepresentation()

static string AnalyzeRe.Perspective.GetStringRepresentation ( Perspective  persp)
static

Generate a string representation of the specified perspective.

◆ LossNetOf()

static Perspective AnalyzeRe.Perspective.LossNetOf ( params Base[]  perspectives)
static

A convenience static method, similar to the other static singletons, which constructs a complex perspective instance that includes Base.NetLoss as well as one or more additional perspectives.

Parameters
perspectivesOne or more additional perspectives to add/subtract from the NetLoss.

If you need a single perspective value, consider using the static FromEnum factory or one of the static singletons (e.g. Perspective.NetLoss) to acquire a more performant and memory-efficient perspective reference.

◆ LossNetOfAggregateTermsAnd()

static Perspective AnalyzeRe.Perspective.LossNetOfAggregateTermsAnd ( bool  premium = false,
bool  reinstatement_premium = false,
bool  reinstatement_brokerage = false 
)
inlinestatic

Constructs a legacy LossNetOfAggregateTerms[X,Y,Z] perspective, where you can specify which values to include in the loss calculation. Be warned that the legacy perspective Base.LossNetOfAggregateTerms implicitly includes all fee record types.

Parameters
premiumSet to true to include Premium Income.
reinstatement_premiumSet to true to include Reinstatement Premium Income.
reinstatement_brokerageSet to true to include Reinstatement Brokerage Fees.
Returns
The customized perspective.

Definition at line 363 of file Perspective.cs.

◆ operator Perspective() [1/2]

static AnalyzeRe.Perspective.operator Perspective ( Base  perspective)
explicitstatic

Implicit converter that converts a Base enum value into a Perspective instance.

Parameters
perspectiveThe perspective value requested.

◆ operator Perspective() [2/2]

static implicit AnalyzeRe.Perspective.operator Perspective ( string  perspectiveString)
static

Implicit converter that allows automatically converting a string into a Perspective instance.

Parameters
perspectiveStringThe string representation of the perspective.

◆ ShallowCopy< T >()

virtual T AnalyzeRe.APIType.ShallowCopy< T > ( )
inlinevirtualinherited

Create a shallow copy of this object.

See also
ExtensionMethods.DeepCopy<T>

for a serializer-based copy method.

Returns
A shallow copy of this object.

If this object contains any members that reference the current object (this), the class should override this method to avoid cloning a reference to the old class.

Implements AnalyzeRe.IAPIType.

Type Constraints
T :IAPIType 

Definition at line 14 of file APIType.cs.

◆ ToString()

override string AnalyzeRe.Perspective.ToString ( )

Perspective string is just the class name.

Member Data Documentation

◆ FixedExpense

readonly Perspective AnalyzeRe.Perspective.FixedExpense = new Perspective(Base.FixedExpense)
static

Report on the structure's Fees.FixedExpense fees.

Definition at line 73 of file Perspective.cs.

◆ LossGross

readonly Perspective AnalyzeRe.Perspective.LossGross = new Perspective(Base.LossGross)
static

Construct a distribution from the structure's gross losses.

Definition at line 58 of file Perspective.cs.

◆ LossNetOfAggregateTerms

readonly Perspective AnalyzeRe.Perspective.LossNetOfAggregateTerms = new Perspective(Base.LossNetOfAggregateTerms)
static

The legacy perspective value indicating "net loss" - but this includes fee record types as well.

Equivalent to requesting the following combined perspectives: NetLoss,FixedExpense,PropoertionalExpense,ProfitCommission,NoClaimsBonus,SlidingScaleCommission

Definition at line 90 of file Perspective.cs.

◆ NetLoss

readonly Perspective AnalyzeRe.Perspective.NetLoss = new Perspective(Base.NetLoss)
static

Construct a distribution from the structure's net losses.

Definition at line 61 of file Perspective.cs.

◆ NoClaimsBonus

readonly Perspective AnalyzeRe.Perspective.NoClaimsBonus = new Perspective(Base.NoClaimsBonus)
static

Report on the structure's Fees.FixedExpense fees.

Definition at line 82 of file Perspective.cs.

◆ Premium

readonly Perspective AnalyzeRe.Perspective.Premium = new Perspective(Base.Premium)
static

Report on the structure's premium only.

Definition at line 64 of file Perspective.cs.

◆ ProfitCommission

readonly Perspective AnalyzeRe.Perspective.ProfitCommission = new Perspective(Base.ProfitCommission)
static

Report on the structure's Fees.FixedExpense fees.

Definition at line 79 of file Perspective.cs.

◆ ProportionalExpense

readonly Perspective AnalyzeRe.Perspective.ProportionalExpense = new Perspective(Base.ProportionalExpense)
static

Report on the structure's Fees.ProportionalExpense fees.

Definition at line 76 of file Perspective.cs.

◆ ReinstatementBrokerage

readonly Perspective AnalyzeRe.Perspective.ReinstatementBrokerage = new Perspective(Base.ReinstatementBrokerage)
static

Construct a distribution from the structure's net reinstatement brokerages.

Definition at line 70 of file Perspective.cs.

◆ ReinstatementPremium

readonly Perspective AnalyzeRe.Perspective.ReinstatementPremium = new Perspective(Base.ReinstatementPremium)
static

Construct a distribution from the structure's net reinstatement premiums.

Definition at line 67 of file Perspective.cs.

◆ SlidingScaleCommission

readonly Perspective AnalyzeRe.Perspective.SlidingScaleCommission = new Perspective(Base.SlidingScaleCommission)
static

Report on the structure's Fees.FixedExpense fees.

Definition at line 85 of file Perspective.cs.


The documentation for this class was generated from the following file: