Beispiel #1
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains a template based on the specified period and convention.
 /// <para>
 /// The near date is equal to the spot date.
 /// The period from the spot date to the far date is specified
 /// </para>
 /// <para>
 /// For example, a '6M' FX swap has a near leg on the spot date and a period from spot to the far date of 6 months
 ///
 /// </para>
 /// </summary>
 /// <param name="periodToFar">  the period between the spot date and the far date </param>
 /// <param name="convention">  the market convention </param>
 /// <returns> the template </returns>
 public static FxSwapTemplate of(Period periodToFar, FxSwapConvention convention)
 {
     return(FxSwapTemplate.builder().periodToNear(Period.ZERO).periodToFar(periodToFar).convention(convention).build());
 }
Beispiel #2
0
 public virtual void test_builder_insufficientInfo()
 {
     assertThrowsIllegalArg(() => FxSwapTemplate.builder().convention(CONVENTION).build());
     assertThrowsIllegalArg(() => FxSwapTemplate.builder().periodToNear(NEAR_PERIOD).build());
     assertThrowsIllegalArg(() => FxSwapTemplate.builder().periodToFar(FAR_PERIOD).build());
 }