Ejemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ImmutableSwapIndex index = ImmutableSwapIndex.builder().name("FooIndex").fixingTime(LocalTime.of(12, 30)).fixingZone(ZoneId.of("Africa/Abidjan")).template(FixedIborSwapTemplate.of(Tenor.TENOR_9M, FixedIborSwapConventions.CHF_FIXED_1Y_LIBOR_3M)).build();

            coverImmutableBean(index);
            coverPrivateConstructor(typeof(SwapIndices));
        }
        private static SwapIndex parseSwapIndex(CsvRow row)
        {
            string name   = row.getField(NAME_FIELD);
            bool   active = bool.Parse(row.getField(ACTIVE_FIELD));
            FixedIborSwapConvention convention = FixedIborSwapConvention.of(row.getField(CONVENTION_FIELD));
            Tenor     tenor  = Tenor.parse(row.getField(TENOR_FIELD));
            LocalTime time   = LocalTime.parse(row.getField(FIXING_TIME_FIELD), TIME_FORMAT);
            ZoneId    zoneId = ZoneId.of(row.getField(FIXING_ZONE_FIELD));

            // build result
            return(ImmutableSwapIndex.builder().name(name).active(active).fixingTime(time).fixingZone(zoneId).template(FixedIborSwapTemplate.of(tenor, convention)).build());
        }
Ejemplo n.º 3
0
        public virtual void test_serialization()
        {
            SwapIndex index = ImmutableSwapIndex.builder().name("FooIndex").fixingTime(LocalTime.of(12, 30)).fixingZone(ZoneId.of("Africa/Abidjan")).template(FixedIborSwapTemplate.of(Tenor.TENOR_9M, FixedIborSwapConventions.CHF_FIXED_1Y_LIBOR_3M)).build();

            assertSerialization(index);
        }