Example usage for org.apache.commons.lang Validate notNull

List of usage examples for org.apache.commons.lang Validate notNull

Introduction

In this page you can find the example usage for org.apache.commons.lang Validate notNull.

Prototype

public static void notNull(Object object, String message) 

Source Link

Document

Validate an argument, throwing IllegalArgumentException if the argument is null.

 Validate.notNull(myObject, "The object must not be null"); 

Usage

From source file:com.opengamma.examples.simulated.convention.SyntheticAUConventions.java

public static synchronized void addFixedIncomeInstrumentConventions(
        final InMemoryConventionBundleMaster conventionMaster) {
    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Following");
    final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("Actual/365");
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);

    //TODO holiday associated with AUD swaps is Sydney
    final ExternalId au = ExternalSchemes.financialRegionId("AU");
    final Integer overnightPublicationLag = 0;

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP1D")), "AUDCASHP1D", act365,
            following, Period.ofDays(1), 0, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP1M")), "AUDCASHP1M", act365,
            modified, Period.ofMonths(1), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP2M")), "AUDCASHP2M", act365,
            modified, Period.ofMonths(2), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP3M")), "AUDCASHP3M", act365,
            modified, Period.ofMonths(3), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP4M")), "AUDCASHP4M", act365,
            modified, Period.ofMonths(4), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP5M")), "AUDCASHP5M", act365,
            modified, Period.ofMonths(5), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP6M")), "AUDCASHP6M", act365,
            modified, Period.ofMonths(6), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP7M")), "AUDCASHP7M", act365,
            modified, Period.ofMonths(7), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP8M")), "AUDCASHP8M", act365,
            modified, Period.ofMonths(8), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP9M")), "AUDCASHP9M", act365,
            modified, Period.ofMonths(9), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP10M")), "AUDCASHP10M", act365,
            modified, Period.ofMonths(10), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP11M")), "AUDCASHP11M", act365,
            modified, Period.ofMonths(1), 2, false, au);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("AUDCASHP12M")), "AUDCASHP12M", act365,
            modified, Period.ofMonths(12), 2, false, au);

    utils.addConventionBundle(//  ww  w  .j  a  v a2s . c  o  m
            ExternalIdBundle.of(syntheticSecurityId("AUDLIBORP3M"), simpleNameSecurityId("AUD LIBOR 3m")),
            "AUD LIBOR 3m", act365, following, Period.ofMonths(3), 2, false, au);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("AUDLIBORP6M"), simpleNameSecurityId("AUD LIBOR 6m")),
            "AUD LIBOR 6m", act365, following, Period.ofMonths(6), 2, false, au);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("AUDLIBORP12M"), simpleNameSecurityId("AUD LIBOR 12m")),
            "AUD LIBOR 12m", act365, following, Period.ofMonths(12), 2, false, au);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("AUDON"), simpleNameSecurityId("RBA OVERNIGHT CASH RATE")),
            "RBA OVERNIGHT CASH RATE", act365, following, Period.ofDays(1), 0, false, au,
            overnightPublicationLag);

    final DayCount swapFixedDayCount = act365;
    final BusinessDayConvention swapFixedBusinessDay = modified;

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("AUD_SWAP")), "AUD_SWAP", act365,
            modified, semiAnnual, 0, au, act365, modified, semiAnnual, 0,
            simpleNameSecurityId(IndexType.BBSW + "_AUD_P6M"), au, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("AUD_3M_SWAP")), "AUD_3M_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, quarterly, 0, au, act365, modified, quarterly, 0,
            simpleNameSecurityId(IndexType.BBSW + "_AUD_P3M"), au, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("AUD_6M_SWAP")), "AUD_6M_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, semiAnnual, 0, au, act365, modified, semiAnnual, 0,
            simpleNameSecurityId(IndexType.BBSW + "_AUD_P6M"), au, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("AUD_OIS_SWAP")), "AUD_OIS_SWAP", act365,
            modified, annual, 0, au, act365, modified, annual, 0,
            simpleNameSecurityId("RBA OVERNIGHT CASH RATE"), au, true, overnightPublicationLag);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("AUDBBP3M"),
                    simpleNameSecurityId(IndexType.BBSW + "_AUD_P3M")),
            "AUD Bank Bill 3m", act365, modified, Period.ofMonths(3), 0, true, au); // "AUD Bank Bill 3m"
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("AUDBBP6M"),
                    simpleNameSecurityId(IndexType.BBSW + "_AUD_P6M")),
            "AUD Bank Bill 6m", act365, modified, Period.ofMonths(6), 0, true, au); // "AUD Bank Bill 6m"
}

From source file:com.opengamma.examples.convention.SyntheticEUConventions.java

public static synchronized void addFixedIncomeInstrumentConventions(
        final ConventionBundleMaster conventionMaster) {
    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final DayCount thirty360 = DayCountFactory.INSTANCE.getDayCount("30/360");
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);

    //TODO holiday associated with EUR swaps is TARGET
    final ExternalId eu = ExternalSchemes.financialRegionId("EU");
    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);
    //EURO LIBOR/*from   w  w w.  j  a  v  a2s. c o  m*/
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EURLIBORP3M"), simpleNameSecurityId("EUR LIBOR 3m")),
            "EUR LIBOR 3m", act360, modified, Period.ofMonths(3), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EURLIBORP6M"), simpleNameSecurityId("EUR LIBOR 6m")),
            "EUR LIBOR 6m", act360, modified, Period.ofMonths(6), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURLIBORP12M")), "EUR LIBOR 12m", act360,
            modified, Period.ofMonths(12), 2, false, eu);

    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP7D"), simpleNameSecurityId("EURIBOR 7d")),
            "EURIBOR 7d", act360, modified, Period.ofDays(7), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP14D"), simpleNameSecurityId("EURIBOR 14d")),
            "EURIBOR 14d", act360, modified, Period.ofDays(14), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP1M"), simpleNameSecurityId("EURIBOR 1m")),
            "EURIBOR 1m", act360, modified, Period.ofMonths(1), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP2M"), simpleNameSecurityId("EURIBOR 2m")),
            "EURIBOR 2m", act360, modified, Period.ofMonths(2), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP3M"), simpleNameSecurityId("EURIBOR 3m")),
            "EURIBOR 3m", act360, modified, Period.ofMonths(3), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP6M"), simpleNameSecurityId("EURIBOR 6m")),
            "EURIBOR 6m", act360, modified, Period.ofMonths(6), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP12M"), simpleNameSecurityId("EURIBOR 12m")),
            "EURIBOR 12m", act360, modified, Period.ofMonths(12), 2, false, eu);

    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP1D")), "EURCASHP1D", act360,
            following, Period.ofDays(1), 0, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP2D")), "EURCASHP2D", act360,
            following, Period.ofDays(2), 0, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP1M")), "EURCASHP1M", act360,
            modified, Period.ofMonths(1), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP2M")), "EURCASHP2M", act360,
            modified, Period.ofMonths(2), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP3M")), "EURCASHP3M", act360,
            modified, Period.ofMonths(3), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP4M")), "EURCASHP4M", act360,
            modified, Period.ofMonths(4), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP5M")), "EURCASHP5M", act360,
            modified, Period.ofMonths(5), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP6M")), "EURCASHP6M", act360,
            modified, Period.ofMonths(6), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP7M")), "EURCASHP7M", act360,
            modified, Period.ofMonths(7), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP8M")), "EURCASHP8M", act360,
            modified, Period.ofMonths(8), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP9M")), "EURCASHP9M", act360,
            modified, Period.ofMonths(9), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP10M")), "EURCASHP10M", act360,
            modified, Period.ofMonths(10), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP11M")), "EURCASHP11M", act360,
            modified, Period.ofMonths(11), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP12M")), "EURCASHP12M", act360,
            modified, Period.ofMonths(12), 2, false, eu);

    final DayCount swapFixedDayCount = thirty360;
    final BusinessDayConvention swapFixedBusinessDay = modified;
    final Frequency swapFixedPaymentFrequency = annual;
    final DayCount euriborDayCount = act360;

    // IRS
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_SWAP")), "EUR_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, swapFixedPaymentFrequency, 2, eu, euriborDayCount,
            modified, semiAnnual, 2, simpleNameSecurityId("EURIBOR 6m"), eu, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_3M_SWAP")), "EUR_3M_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, swapFixedPaymentFrequency, 2, eu, act360, modified,
            quarterly, 2, simpleNameSecurityId("EURIBOR 3m"), eu, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_6M_SWAP")), "EUR_6M_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, swapFixedPaymentFrequency, 2, eu, act360, modified,
            semiAnnual, 2, simpleNameSecurityId("EURIBOR 6m"), eu, true);

    final int publicationLagON = 0;
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EONIA"), simpleNameSecurityId("EUR EONIA")), "EUR EONIA",
            act360, modified, Period.ofDays(1), 0, false, eu, publicationLagON);
    // OIS - EONIA
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_OIS_SWAP")), "EUR_OIS_SWAP", act360,
            modified, annual, 2, eu, act360, modified, annual, 2, simpleNameSecurityId("EUR EONIA"), eu, true,
            publicationLagON);

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_3M_FRA")), "EUR_3M_FRA", thirty360,
            modified, quarterly, 2, eu, act360, modified, quarterly, 2, simpleNameSecurityId("EURIBOR 3m"), eu,
            true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_6M_FRA")), "EUR_6M_FRA", thirty360,
            modified, annual, 2, eu, act360, modified, semiAnnual, 2, simpleNameSecurityId("EURIBOR 6m"), eu,
            true);

}

From source file:com.opengamma.examples.simulated.convention.SyntheticEUConventions.java

public static synchronized void addFixedIncomeInstrumentConventions(
        final ConventionBundleMaster conventionMaster) {
    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final DayCount thirty360 = DayCountFactory.INSTANCE.getDayCount("30/360");
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);

    //TODO holiday associated with EUR swaps is TARGET
    final ExternalId eu = ExternalSchemes.financialRegionId("EU");
    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);
    //EURO LIBOR/*  w w  w  .  ja  v a 2 s.c o  m*/
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EURLIBORP3M"), simpleNameSecurityId("EUR LIBOR 3m")),
            "EUR LIBOR 3m", act360, modified, Period.ofMonths(3), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EURLIBORP6M"), simpleNameSecurityId("EUR LIBOR 6m")),
            "EUR LIBOR 6m", act360, modified, Period.ofMonths(6), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURLIBORP12M")), "EUR LIBOR 12m", act360,
            modified, Period.ofMonths(12), 2, false, eu);

    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP7D"), simpleNameSecurityId("EURIBOR 7d")),
            "EURIBOR 7d", act360, modified, Period.ofDays(7), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP14D"), simpleNameSecurityId("EURIBOR 14d")),
            "EURIBOR 14d", act360, modified, Period.ofDays(14), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP1M"), simpleNameSecurityId("EURIBOR 1m")),
            "EURIBOR 1m", act360, modified, Period.ofMonths(1), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP2M"), simpleNameSecurityId("EURIBOR 2m")),
            "EURIBOR 2m", act360, modified, Period.ofMonths(2), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP3M"), simpleNameSecurityId("EURIBOR 3m")),
            "EURIBOR 3m", act360, modified, Period.ofMonths(3), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP6M"), simpleNameSecurityId("EURIBOR 6m")),
            "EURIBOR 6m", act360, modified, Period.ofMonths(6), 2, false, eu);
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EUREURIBORP12M"), simpleNameSecurityId("EURIBOR 12m")),
            "EURIBOR 12m", act360, modified, Period.ofMonths(12), 2, false, eu);

    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP1D")), "EURCASHP1D", act360,
            following, Period.ofDays(1), 0, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP2D")), "EURCASHP2D", act360,
            following, Period.ofDays(2), 0, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP1M")), "EURCASHP1M", act360,
            modified, Period.ofMonths(1), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP2M")), "EURCASHP2M", act360,
            modified, Period.ofMonths(2), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP3M")), "EURCASHP3M", act360,
            modified, Period.ofMonths(3), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP4M")), "EURCASHP4M", act360,
            modified, Period.ofMonths(4), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP5M")), "EURCASHP5M", act360,
            modified, Period.ofMonths(5), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP6M")), "EURCASHP6M", act360,
            modified, Period.ofMonths(6), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP7M")), "EURCASHP7M", act360,
            modified, Period.ofMonths(7), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP8M")), "EURCASHP8M", act360,
            modified, Period.ofMonths(8), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP9M")), "EURCASHP9M", act360,
            modified, Period.ofMonths(9), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP10M")), "EURCASHP10M", act360,
            modified, Period.ofMonths(10), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP11M")), "EURCASHP11M", act360,
            modified, Period.ofMonths(11), 2, false, eu);
    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("EURCASHP12M")), "EURCASHP12M", act360,
            modified, Period.ofMonths(12), 2, false, eu);

    final DayCount swapFixedDayCount = thirty360;
    final BusinessDayConvention swapFixedBusinessDay = modified;
    final Frequency swapFixedPaymentFrequency = annual;
    final DayCount euriborDayCount = act360;

    // IRS
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_SWAP")), "EUR_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, swapFixedPaymentFrequency, 2, eu, euriborDayCount,
            modified, semiAnnual, 2, simpleNameSecurityId("EURIBOR 6m"), eu, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_3M_SWAP")), "EUR_3M_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, swapFixedPaymentFrequency, 2, eu, act360, modified,
            quarterly, 2, simpleNameSecurityId("EURIBOR 3m"), eu, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_6M_SWAP")), "EUR_6M_SWAP",
            swapFixedDayCount, swapFixedBusinessDay, swapFixedPaymentFrequency, 2, eu, act360, modified,
            semiAnnual, 2, simpleNameSecurityId("EURIBOR 6m"), eu, true);

    // IR FUTURES
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_IR_FUTURE")), "EUR_IR_FUTURE",
            euriborDayCount, modified, Period.ofMonths(3), 2, true, null);

    final int publicationLagON = 0;
    utils.addConventionBundle(
            ExternalIdBundle.of(syntheticSecurityId("EONIA"), simpleNameSecurityId("EUR EONIA")), "EUR EONIA",
            act360, modified, Period.ofDays(1), 0, false, eu, publicationLagON);
    // OIS - EONIA
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_OIS_SWAP")), "EUR_OIS_SWAP", act360,
            modified, annual, 2, eu, act360, modified, annual, 2, simpleNameSecurityId("EUR EONIA"), eu, true,
            publicationLagON);

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_3M_FRA")), "EUR_3M_FRA", thirty360,
            modified, quarterly, 2, eu, act360, modified, quarterly, 2, simpleNameSecurityId("EURIBOR 3m"), eu,
            true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("EUR_6M_FRA")), "EUR_6M_FRA", thirty360,
            modified, annual, 2, eu, act360, modified, semiAnnual, 2, simpleNameSecurityId("EURIBOR 6m"), eu,
            true);

}

From source file:com.opengamma.analytics.math.interpolation.data.Interpolator2DDataBundle.java

public Interpolator2DDataBundle(final double[] xData, final double[] yData, final double[] zData) {
    Validate.notNull(xData, "x data");
    Validate.notNull(yData, "y data");
    Validate.notNull(zData, "z data");
    final int n = xData.length;
    Validate.isTrue(n == yData.length);//from   w  w w.j  a v a 2  s.c  om
    Validate.isTrue(n == zData.length);
    _xData = xData;
    _yData = yData;
    _zData = zData;
}

From source file:com.opengamma.analytics.financial.model.tree.RecombiningTree.java

public RecombiningTree(final T[][] data) {
    Validate.notNull(data, "data");
    ArgumentChecker.notEmpty(data, "data");
    _tree = data;
}

From source file:com.opengamma.analytics.financial.model.option.pricing.analytic.formula.AmericanVanillaOption.java

public static AmericanVanillaOption fromDefinition(final AmericanVanillaOptionDefinition definition,
        final ZonedDateTime date) {
    Validate.notNull(definition, "definition");
    Validate.notNull(date, "date");
    return new AmericanVanillaOption(definition.getStrike(), definition.getTimeToExpiry(date),
            definition.isCall());//from   w  w w  .  ja  va 2 s.c o  m
}

From source file:com.opengamma.financial.analytics.volatility.surface.ConfigDBFuturePriceCurveDefinitionSource.java

public ConfigDBFuturePriceCurveDefinitionSource(final ConfigSource configSource) {
    Validate.notNull(configSource, "config source");
    _configSource = configSource;
}

From source file:com.opengamma.financial.convention.JPConventions.java

public static synchronized void addFixedIncomeInstrumentConventions(
        final ConventionBundleMaster conventionMaster) {
    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE
            .getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("Actual/365");
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);
    final ExternalId jp = ExternalSchemes.financialRegionId("JP");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    utils.addConventionBundle(//  www  .  j  a v  a  2  s  . com
            ExternalIdBundle.of(bloombergTickerSecurityId("JY00O/N Index"),
                    simpleNameSecurityId("JPY LIBOR O/N")),
            "JPY LIBOR O/N", act360, following, Period.ofDays(1), 0, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY00S/N Index"),
                    simpleNameSecurityId("JPY LIBOR S/N")),
            "JPY LIBOR S/N", act360, following, Period.ofDays(1), 0, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY00T/N Index"),
                    simpleNameSecurityId("JPY LIBOR T/N")),
            "JPY LIBOR T/N", act360, following, Period.ofDays(1), 0, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0001W Index"),
                    simpleNameSecurityId("JPY LIBOR 1w")),
            "JPY LIBOR 1w", act360, following, Period.ofDays(1), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0002W Index"),
                    simpleNameSecurityId("JPY LIBOR 2w")),
            "JPY LIBOR 2w", act360, following, Period.ofDays(1), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0001M Index"),
                    simpleNameSecurityId("JPY LIBOR 1m")),
            "JPY LIBOR 1m", act360, following, Period.ofMonths(1), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0002M Index"),
                    simpleNameSecurityId("JPY LIBOR 2m")),
            "JPY LIBOR 2m", act360, following, Period.ofMonths(2), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0003M Index"),
                    simpleNameSecurityId("JPY LIBOR 3m")),
            "JPY LIBOR 3m", act360, following, Period.ofMonths(3), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0004M Index"),
                    simpleNameSecurityId("JPY LIBOR 4m")),
            "JPY LIBOR 4m", act360, following, Period.ofMonths(4), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0005M Index"),
                    simpleNameSecurityId("JPY LIBOR 5m")),
            "JPY LIBOR 5m", act360, following, Period.ofMonths(5), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0006M Index"),
                    simpleNameSecurityId("JPY LIBOR 6m")),
            "JPY LIBOR 6m", act360, following, Period.ofMonths(6), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0007M Index"),
                    simpleNameSecurityId("JPY LIBOR 7m")),
            "JPY LIBOR 7m", act360, following, Period.ofMonths(7), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0008M Index"),
                    simpleNameSecurityId("JPY LIBOR 8m")),
            "JPY LIBOR 8m", act360, following, Period.ofMonths(8), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0009M Index"),
                    simpleNameSecurityId("JPY LIBOR 9m")),
            "JPY LIBOR 9m", act360, following, Period.ofMonths(9), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0010M Index"),
                    simpleNameSecurityId("JPY LIBOR 10m")),
            "JPY LIBOR 10m", act360, following, Period.ofMonths(10), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0011M Index"),
                    simpleNameSecurityId("JPY LIBOR 11m")),
            "JPY LIBOR 11m", act360, following, Period.ofMonths(11), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JY0012M Index"),
                    simpleNameSecurityId("JPY LIBOR 12m")),
            "JPY LIBOR 12m", act360, following, Period.ofMonths(12), 2, false, jp);

    //TODO need to check that these are right for deposit rates
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR1T Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 1d")),
            "JPY DEPOSIT 1d", act360, following, Period.ofDays(1), 0, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR2T Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 2d")),
            "JPY DEPOSIT 2d", act360, following, Period.ofDays(1), 0, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR3T Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 3d")),
            "JPY DEPOSIT 3d", act360, following, Period.ofDays(1), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR1Z Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 1w")),
            "JPY DEPOSIT 1w", act360, following, Period.ofDays(7), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR2Z Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 2w")),
            "JPY DEPOSIT 2w", act360, following, Period.ofDays(14), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR3Z Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 3w")),
            "JPY DEPOSIT 3w", act360, following, Period.ofDays(21), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRA Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 1m")),
            "JPY DEPOSIT 1m", act360, following, Period.ofMonths(1), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRB Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 2m")),
            "JPY DEPOSIT 2m", act360, following, Period.ofMonths(2), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRC Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 3m")),
            "JPY DEPOSIT 3m", act360, following, Period.ofMonths(3), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRD Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 4m")),
            "JPY DEPOSIT 4m", act360, following, Period.ofMonths(4), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRE Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 5m")),
            "JPY DEPOSIT 5m", act360, following, Period.ofMonths(5), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRF Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 6m")),
            "JPY DEPOSIT 6m", act360, following, Period.ofMonths(6), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRG Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 7m")),
            "JPY DEPOSIT 7m", act360, following, Period.ofMonths(7), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRH Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 8m")),
            "JPY DEPOSIT 8m", act360, following, Period.ofMonths(8), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRI Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 9m")),
            "JPY DEPOSIT 9m", act360, following, Period.ofMonths(9), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRJ Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 10m")),
            "JPY DEPOSIT 10m", act360, following, Period.ofMonths(10), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDRK Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 11m")),
            "JPY DEPOSIT 11m", act360, following, Period.ofMonths(11), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR1 Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 1y")),
            "JPY DEPOSIT 1y", act360, following, Period.ofYears(1), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR2 Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 2y")),
            "JPY DEPOSIT 2y", act360, following, Period.ofYears(2), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR3 Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 3y")),
            "JPY DEPOSIT 3y", act360, following, Period.ofYears(3), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR4 Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 4y")),
            "JPY DEPOSIT 4y", act360, following, Period.ofYears(4), 2, false, jp);
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("JYDR5 Curncy"),
                    simpleNameSecurityId("JPY DEPOSIT 5y")),
            "JPY DEPOSIT 5y", act360, following, Period.ofYears(5), 2, false, jp);

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_SWAP")), "JPY_SWAP", act365,
            modified, semiAnnual, 2, jp, act360, modified, semiAnnual, 2, simpleNameSecurityId("JPY LIBOR 6m"),
            jp, true);

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_3M_SWAP")), "JPY_3M_SWAP", act365,
            modified, semiAnnual, 2, jp, act360, modified, quarterly, 2, simpleNameSecurityId("JPY LIBOR 3m"),
            jp, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_6M_SWAP")), "JPY_6M_SWAP", act365,
            modified, semiAnnual, 2, jp, act360, modified, semiAnnual, 2, simpleNameSecurityId("JPY LIBOR 6m"),
            jp, true);

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_3M_FRA")), "JPY_3M_FRA", act365,
            modified, semiAnnual, 2, jp, act360, modified, quarterly, 2, simpleNameSecurityId("JPY LIBOR 3m"),
            jp, true);
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_6M_FRA")), "JPY_6M_FRA", act365,
            modified, semiAnnual, 2, jp, act360, modified, semiAnnual, 2, simpleNameSecurityId("JPY LIBOR 6m"),
            jp, true);

    // Overnight Index Swap Convention have additional flag, publicationLag
    final Integer publicationLag = 0;
    // TONAR
    utils.addConventionBundle(
            ExternalIdBundle.of(bloombergTickerSecurityId("MUTSCALM Index"), simpleNameSecurityId("JPY TONAR")),
            "JPY TONAR", act365, following, Period.ofDays(1), 2, false, jp, publicationLag);
    // OIS - TONAR
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_OIS_SWAP")), "JPY_OIS_SWAP", act365,
            modified, annual, 2, jp, act365, modified, annual, 2, simpleNameSecurityId("JPY TONAR"), jp, true,
            publicationLag);

    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_OIS_CASH")), "JPY_OIS_CASH", act365,
            following, null, 2, false, null);

    //TODO check this
    utils.addConventionBundle(ExternalIdBundle.of(simpleNameSecurityId("JPY_IBOR_INDEX")), "JPY_IBOR_INDEX",
            act360, following, 2, false);
}

From source file:com.opengamma.analytics.financial.model.volatility.smile.function.SVIFormulaData.java

public SVIFormulaData(final double[] parameters) {
    Validate.notNull(parameters, "parameters are null");
    Validate.isTrue(parameters.length == NUM_PARAMETERS, "must be " + NUM_PARAMETERS + " parameters");
    Validate.isTrue(parameters[0] >= 0, "Need a >= 0");
    Validate.isTrue(parameters[1] >= 0, "Need b >= 0");
    Validate.isTrue(parameters[2] >= -1 && parameters[2] <= 1, "Need -1 <= rho <= 1");
    Validate.isTrue(parameters[3] >= 0, "Need nu >= 0");

    _parameters = new double[NUM_PARAMETERS];
    System.arraycopy(parameters, 0, _parameters, 0, NUM_PARAMETERS);
}

From source file:com.opengamma.financial.analytics.volatility.surface.ConfigDBFuturePriceCurveSpecificationSource.java

public ConfigDBFuturePriceCurveSpecificationSource(final ConfigSource configSource) {
    Validate.notNull(configSource, "config source");
    _configSource = configSource;
}