public override Builder set(string propertyName, object newValue) { switch (propertyName.GetHashCode()) { case -1321546630: // template this.template_Renamed = (ThreeLegBasisSwapTemplate)newValue; break; case -938107365: // rateId this.rateId_Renamed = (ObservableId)newValue; break; case 291232890: // additionalSpread this.additionalSpread_Renamed = (double?)newValue.Value; break; case 102727412: // label this.label_Renamed = (string)newValue; break; case 3076014: // date this.date_Renamed = (CurveNodeDate)newValue; break; case -263699392: // dateOrder this.dateOrder_Renamed = (CurveNodeDateOrder)newValue; break; default: throw new NoSuchElementException("Unknown property: " + propertyName); } return(this); }
/// <summary> /// Restricted copy constructor. </summary> /// <param name="beanToCopy"> the bean to copy from, not null </param> internal Builder(ThreeLegBasisSwapCurveNode beanToCopy) { this.template_Renamed = beanToCopy.Template; this.rateId_Renamed = beanToCopy.RateId; this.additionalSpread_Renamed = beanToCopy.AdditionalSpread; this.label_Renamed = beanToCopy.Label; this.date_Renamed = beanToCopy.Date; this.dateOrder_Renamed = beanToCopy.DateOrder; }
private ThreeLegBasisSwapCurveNode(ThreeLegBasisSwapTemplate template, ObservableId rateId, double additionalSpread, string label, CurveNodeDate date, CurveNodeDateOrder dateOrder) { JodaBeanUtils.notNull(template, "template"); JodaBeanUtils.notNull(rateId, "rateId"); JodaBeanUtils.notEmpty(label, "label"); JodaBeanUtils.notNull(dateOrder, "dateOrder"); this.template = template; this.rateId = rateId; this.additionalSpread = additionalSpread; this.label = label; this.date_Renamed = date; this.dateOrder = dateOrder; }
private static CurveNode curveThreeLegBasisCurveNode(string conventionStr, string timeStr, string label, QuoteId quoteId, double spread, CurveNodeDate date, CurveNodeDateOrder order) { Matcher matcher = SIMPLE_YM_TIME_REGEX.matcher(timeStr.ToUpper(Locale.ENGLISH)); if (!matcher.matches()) { throw new System.ArgumentException(Messages.format("Invalid time format for Three legs basis swap: {}", timeStr)); } Period periodToEnd = Period.parse("P" + matcher.group(1)); ThreeLegBasisSwapConvention convention = ThreeLegBasisSwapConvention.of(conventionStr); ThreeLegBasisSwapTemplate template = ThreeLegBasisSwapTemplate.of(Tenor.of(periodToEnd), convention); return(ThreeLegBasisSwapCurveNode.builder().template(template).rateId(quoteId).additionalSpread(spread).label(label).date(date).dateOrder(order).build()); }
//----------------------------------------------------------------------- /// <summary> /// Sets the template for the swap associated with this node. </summary> /// <param name="template"> the new value, not null </param> /// <returns> this, for chaining, not null </returns> public Builder template(ThreeLegBasisSwapTemplate template) { JodaBeanUtils.notNull(template, "template"); this.template_Renamed = template; return(this); }
/// <summary> /// Returns a curve node for a three leg basis swap using the specified instrument template, rate key, spread and label. /// </summary> /// <param name="template"> the template defining the node instrument </param> /// <param name="rateId"> the identifier of the market data providing the rate for the node instrument </param> /// <param name="additionalSpread"> the additional spread amount added to the market quote </param> /// <param name="label"> the label to use for the node, if null or empty an appropriate default label will be used </param> /// <returns> a node whose instrument is built from the template using a market rate </returns> public static ThreeLegBasisSwapCurveNode of(ThreeLegBasisSwapTemplate template, ObservableId rateId, double additionalSpread, string label) { return(new ThreeLegBasisSwapCurveNode(template, rateId, additionalSpread, label, CurveNodeDate.END, CurveNodeDateOrder.DEFAULT)); }
/// <summary> /// Returns a curve node for a three leg basis swap using the specified instrument template, rate key and spread. /// <para> /// A suitable default label will be created. /// /// </para> /// </summary> /// <param name="template"> the template defining the node instrument </param> /// <param name="rateId"> the identifier of the market data providing the rate for the node instrument </param> /// <param name="additionalSpread"> the additional spread amount added to the market quote </param> /// <returns> a node whose instrument is built from the template using a market rate </returns> public static ThreeLegBasisSwapCurveNode of(ThreeLegBasisSwapTemplate template, ObservableId rateId, double additionalSpread) { return(builder().template(template).rateId(rateId).additionalSpread(additionalSpread).build()); }
//------------------------------------------------------------------------- /// <summary> /// Returns a curve node for a three leg basis swap using the /// specified instrument template and rate. /// <para> /// A suitable default label will be created. /// /// </para> /// </summary> /// <param name="template"> the template used for building the instrument for the node </param> /// <param name="rateId"> the identifier of the market rate used when building the instrument for the node </param> /// <returns> a node whose instrument is built from the template using a market rate </returns> public static ThreeLegBasisSwapCurveNode of(ThreeLegBasisSwapTemplate template, ObservableId rateId) { return(of(template, rateId, 0d)); }