/// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ImmutableFloatingRateName beanToCopy)
 {
     this.externalName_Renamed         = beanToCopy.ExternalName;
     this.indexName_Renamed            = beanToCopy.IndexName;
     this.type_Renamed                 = beanToCopy.Type;
     this.fixingDateOffsetDays_Renamed = beanToCopy.fixingDateOffsetDays;
 }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case -1386121994:         // externalName
                    this.externalName_Renamed = (string)newValue;
                    break;

                case -807707011:         // indexName
                    this.indexName_Renamed = (string)newValue;
                    break;

                case 3575610:         // type
                    this.type_Renamed = (FloatingRateType)newValue;
                    break;

                case -594001179:         // fixingDateOffsetDays
                    this.fixingDateOffsetDays_Renamed = (int?)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "nameType") public void test_name(String name, String indexName, FloatingRateType type)
        public virtual void test_name(string name, string indexName, FloatingRateType type)
        {
            FloatingRateName test = FloatingRateName.of(name);

            assertEquals(test.Name, name);
            assertEquals(test.Type, type);
            assertEquals(test.Currency, test.toFloatingRateIndex().Currency);
        }
 private ImmutableFloatingRateName(string externalName, string indexName, FloatingRateType type, int?fixingDateOffsetDays)
 {
     JodaBeanUtils.notEmpty(externalName, "externalName");
     JodaBeanUtils.notEmpty(indexName, "indexName");
     JodaBeanUtils.notNull(type, "type");
     this.externalName         = externalName;
     this.indexName            = indexName;
     this.type                 = type;
     this.fixingDateOffsetDays = fixingDateOffsetDays;
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance from the specified external name, index name and type.
 /// </summary>
 /// <param name="externalName">  the unique name </param>
 /// <param name="indexName">  the name of the index </param>
 /// <param name="type">  the type - Ibor, Overnight or Price </param>
 /// <returns> the name </returns>
 /// <exception cref="IllegalArgumentException"> if the name is not known </exception>
 public static ImmutableFloatingRateName of(string externalName, string indexName, FloatingRateType type)
 {
     return(new ImmutableFloatingRateName(externalName, indexName, type, null));
 }
 /// <summary>
 /// Sets the type of the index. </summary>
 /// <param name="type">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder type(FloatingRateType type)
 {
     JodaBeanUtils.notNull(type, "type");
     this.type_Renamed = type;
     return(this);
 }
 /// <summary>
 /// Obtains an instance from the specified external name, index name and type.
 /// </summary>
 /// <param name="externalName">  the unique name </param>
 /// <param name="indexName">  the name of the index </param>
 /// <param name="type">  the type - Ibor, Overnight or Price </param>
 /// <param name="fixingDateOffsetDays">  the fixing date offset, in days, negative to use the standard </param>
 /// <returns> the name </returns>
 /// <exception cref="IllegalArgumentException"> if the name is not known </exception>
 public static ImmutableFloatingRateName of(string externalName, string indexName, FloatingRateType type, int fixingDateOffsetDays)
 {
     return(new ImmutableFloatingRateName(externalName, indexName, type, fixingDateOffsetDays >= 0 ? fixingDateOffsetDays : null));
 }
 // parse a single section
 internal static void parseSection(PropertySet section, string indexNameSuffix, FloatingRateType type, Dictionary <string, ImmutableFloatingRateName> mutableMap)
 {
     // find our names from the RHS of the key/value pairs
     foreach (string key in section.keys())
     {
         ImmutableFloatingRateName name = ImmutableFloatingRateName.of(key, section.value(key) + indexNameSuffix, type);
         mutableMap[key] = name;
         if (!mutableMap.ContainsKey(key.ToUpper(Locale.ENGLISH)))
         {
             mutableMap.Add(key.ToUpper(Locale.ENGLISH), name);
         }
     }
 }
 public virtual void test_of_lookup_notFound()
 {
     assertThrowsIllegalArg(() => FloatingRateType.of("Rubbish"));
 }
//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_lookupLowerCase(FloatingRateType convention, String name)
        public virtual void test_of_lookupLowerCase(FloatingRateType convention, string name)
        {
            assertEquals(FloatingRateType.of(name.ToLower(Locale.ENGLISH)), convention);
        }
//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(FloatingRateType convention, String name)
        public virtual void test_of_lookup(FloatingRateType convention, string name)
        {
            assertEquals(FloatingRateType.of(name), convention);
        }
//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(FloatingRateType convention, String name)
        public virtual void test_toString(FloatingRateType convention, string name)
        {
            assertEquals(convention.ToString(), name);
        }
 public virtual void test_of_lookup_null()
 {
     assertThrowsIllegalArg(() => FloatingRateType.of(null));
 }
Пример #14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "nameType") public void test_of_lookup(String name, String indexName, FloatingRateType type)
        public virtual void test_of_lookup(string name, string indexName, FloatingRateType type)
        {
            FloatingRateName test = FloatingRateName.of(name);

            assertEquals(FloatingRateName.of(name), test);
        }
Пример #15
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "nameType") public void test_toString(String name, String indexName, FloatingRateType type)
        public virtual void test_toString(string name, string indexName, FloatingRateType type)
        {
            FloatingRateName test = FloatingRateName.of(name);

            assertEquals(test.ToString(), name);
        }