public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3575610:         // type
                    this.type_Renamed = (SwapLegType)newValue;
                    break;

                case -885469925:         // payReceive
                    this.payReceive_Renamed = (PayReceive)newValue;
                    break;

                case -2129778896:         // startDate
                    this.startDate_Renamed = (AdjustableDate)newValue;
                    break;

                case -1607727319:         // endDate
                    this.endDate_Renamed = (AdjustableDate)newValue;
                    break;

                case 575402001:         // currency
                    this.currency_Renamed = (Currency)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(MockSwapLeg beanToCopy)
 {
     this.type_Renamed       = beanToCopy.Type;
     this.payReceive_Renamed = beanToCopy.PayReceive;
     this.startDate_Renamed  = beanToCopy.StartDate;
     this.endDate_Renamed    = beanToCopy.EndDate;
     this.currency_Renamed   = beanToCopy.Currency;
 }
 private MockSwapLeg(SwapLegType type, PayReceive payReceive, AdjustableDate startDate, AdjustableDate endDate, Currency currency)
 {
     this.type       = type;
     this.payReceive = payReceive;
     this.startDate  = startDate;
     this.endDate    = endDate;
     this.currency   = currency;
 }
        //-------------------------------------------------------------------------
        /// <summary>
        /// Gets the legs of the swap with the specified type.
        /// <para>
        /// This returns all the legs with the given type.
        ///
        /// </para>
        /// </summary>
        /// <param name="type">  the type to find </param>
        /// <returns> the matching legs of the swap </returns>
        public ImmutableList <SwapLeg> getLegs(SwapLegType type)
        {
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            return(legs.Where(leg => leg.Type == type).collect(toImmutableList()));
        }
 public static MockSwapLeg of(SwapLegType type, PayReceive payReceive, LocalDate startDate, LocalDate endDate, Currency currency)
 {
     return(new MockSwapLeg(type, payReceive, AdjustableDate.of(startDate), AdjustableDate.of(endDate), currency));
 }
 //-----------------------------------------------------------------------
 /// <summary>
 /// Sets the type. </summary>
 /// <param name="type">  the new value </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder type(SwapLegType type)
 {
     this.type_Renamed = type;
     return(this);
 }
Exemple #7
0
 public virtual void test_of_lookup_null()
 {
     assertThrows(() => SwapLegType.of(null), typeof(System.ArgumentException));
 }
Exemple #8
0
 public virtual void test_of_lookup_notFound()
 {
     assertThrows(() => SwapLegType.of("Rubbish"), typeof(System.ArgumentException));
 }
Exemple #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_of_lookup(SwapLegType convention, String name)
        public virtual void test_of_lookup(SwapLegType convention, string name)
        {
            assertEquals(SwapLegType.of(name), convention);
        }
Exemple #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_toString(SwapLegType convention, String name)
        public virtual void test_toString(SwapLegType convention, string name)
        {
            assertEquals(convention.ToString(), name);
        }