Package com.opengamma.financial.spring

Source Code of com.opengamma.financial.spring.ConfigMasterPopulatorsFactoryBean$Meta

/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.spring;

import java.util.Map;

import org.joda.beans.BeanBuilder;
import org.joda.beans.BeanDefinition;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.direct.DirectBean;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaBean;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;
import org.springframework.beans.factory.InitializingBean;

import com.opengamma.financial.analytics.fxforwardcurve.FXForwardCurveConfigPopulator;
import com.opengamma.financial.analytics.ircurve.YieldCurveConfigPopulator;
import com.opengamma.financial.analytics.ircurve.calcconfig.MultiCurveCalculationConfigPopulator;
import com.opengamma.financial.analytics.volatility.cube.VolatilityCubeConfigPopulator;
import com.opengamma.financial.analytics.volatility.surface.EquityOptionSurfaceConfigPopulator;
import com.opengamma.financial.analytics.volatility.surface.FXOptionVolatilitySurfaceConfigPopulator;
import com.opengamma.financial.analytics.volatility.surface.IRFutureOptionSurfaceConfigPopulator;
import com.opengamma.financial.analytics.volatility.surface.SwaptionVolatilitySurfaceConfigPopulator;
import com.opengamma.financial.currency.CurrencyMatrixConfigPopulator;
import com.opengamma.master.config.ConfigMaster;
import com.opengamma.util.ArgumentChecker;

/**
* Spring factory bean to create the database config master.
*/
@BeanDefinition
public class ConfigMasterPopulatorsFactoryBean extends DirectBean implements InitializingBean {

  /**
   * The config master.
   */
  @PropertyDefinition
  private ConfigMaster _configMaster;
  /**
   * The flag to create the yield curves in the config master.
   */
  @PropertyDefinition
  private boolean _yieldCurve;
  /**
   * The flag to create the currency matrix in the config master.
   */
  @PropertyDefinition
  private boolean _currencyMatrix;
  /**
   * The flag to create the surfaces in the config master.
   */
  @PropertyDefinition
  private boolean _swaptionVolatilitySurface;
  /**
   * The flag to create the surfaces in the config master.
   */
  @PropertyDefinition
  private boolean _irFutureOptionSurface;
  /**
   * The flag to create the surfaces in the config master.
   */
  @PropertyDefinition
  private boolean _fxOptionVolatilitySurface;
  /**
   * The flag to create the surfaces in the config master.
   */
  @PropertyDefinition
  private boolean _equityOptionSurface;
  /**
   * The flag to create the volatility cubes in the config master.
   */
  @PropertyDefinition
  private boolean _volatilityCube;
  /**
   * The flag to create the FX forward curves in the config master.
   */
  @PropertyDefinition
  private boolean _fxForwardCurve;
  /**
   * The flag to create curve calculation configurations in the config master.
   */
  @PropertyDefinition
  private boolean _curveCalculationConfiguration;

  //-------------------------------------------------------------------------
  @Override
  public void afterPropertiesSet() {
    final ConfigMaster cm = getConfigMaster();
    ArgumentChecker.notNull(cm, "ConfigMaster");

    if (isYieldCurve()) {
      new YieldCurveConfigPopulator(cm);
    }
    if (isCurrencyMatrix()) {
      // TODO: [PLAT-2379] This won't work if the currency pair conventions aren't already loaded
      CurrencyMatrixConfigPopulator.populateCurrencyMatrixConfigMaster(cm);
    }
    if (isSwaptionVolatilitySurface()) {
      new SwaptionVolatilitySurfaceConfigPopulator(cm);
    }
    if (isIrFutureOptionSurface()) {
      new IRFutureOptionSurfaceConfigPopulator(cm);
    }
    if (isFxOptionVolatilitySurface()) {
      new FXOptionVolatilitySurfaceConfigPopulator(cm);
    }
    if (isEquityOptionSurface()) {
      new EquityOptionSurfaceConfigPopulator(cm);
    }
    if (isVolatilityCube()) {
      new VolatilityCubeConfigPopulator(cm);
    }
    if (isFxForwardCurve()) {
      new FXForwardCurveConfigPopulator(cm);
    }
    if (isCurveCalculationConfiguration()) {
      new MultiCurveCalculationConfigPopulator(cm);
    }
  }

  //------------------------- AUTOGENERATED START -------------------------
  ///CLOVER:OFF
  /**
   * The meta-bean for {@code ConfigMasterPopulatorsFactoryBean}.
   * @return the meta-bean, not null
   */
  public static ConfigMasterPopulatorsFactoryBean.Meta meta() {
    return ConfigMasterPopulatorsFactoryBean.Meta.INSTANCE;
  }

  static {
    JodaBeanUtils.registerMetaBean(ConfigMasterPopulatorsFactoryBean.Meta.INSTANCE);
  }

  @Override
  public ConfigMasterPopulatorsFactoryBean.Meta metaBean() {
    return ConfigMasterPopulatorsFactoryBean.Meta.INSTANCE;
  }

  @Override
  protected Object propertyGet(String propertyName, boolean quiet) {
    switch (propertyName.hashCode()) {
      case 10395716// configMaster
        return getConfigMaster();
      case 1112236386// yieldCurve
        return isYieldCurve();
      case -506174670// currencyMatrix
        return isCurrencyMatrix();
      case -1209267103// swaptionVolatilitySurface
        return isSwaptionVolatilitySurface();
      case -1409170036// irFutureOptionSurface
        return isIrFutureOptionSurface();
      case -973280351// fxOptionVolatilitySurface
        return isFxOptionVolatilitySurface();
      case 1198258099// equityOptionSurface
        return isEquityOptionSurface();
      case 69583354// volatilityCube
        return isVolatilityCube();
      case -1016191204// fxForwardCurve
        return isFxForwardCurve();
      case 364174524// curveCalculationConfiguration
        return isCurveCalculationConfiguration();
    }
    return super.propertyGet(propertyName, quiet);
  }

  @Override
  protected void propertySet(String propertyName, Object newValue, boolean quiet) {
    switch (propertyName.hashCode()) {
      case 10395716// configMaster
        setConfigMaster((ConfigMaster) newValue);
        return;
      case 1112236386// yieldCurve
        setYieldCurve((Boolean) newValue);
        return;
      case -506174670// currencyMatrix
        setCurrencyMatrix((Boolean) newValue);
        return;
      case -1209267103// swaptionVolatilitySurface
        setSwaptionVolatilitySurface((Boolean) newValue);
        return;
      case -1409170036// irFutureOptionSurface
        setIrFutureOptionSurface((Boolean) newValue);
        return;
      case -973280351// fxOptionVolatilitySurface
        setFxOptionVolatilitySurface((Boolean) newValue);
        return;
      case 1198258099// equityOptionSurface
        setEquityOptionSurface((Boolean) newValue);
        return;
      case 69583354// volatilityCube
        setVolatilityCube((Boolean) newValue);
        return;
      case -1016191204// fxForwardCurve
        setFxForwardCurve((Boolean) newValue);
        return;
      case 364174524// curveCalculationConfiguration
        setCurveCalculationConfiguration((Boolean) newValue);
        return;
    }
    super.propertySet(propertyName, newValue, quiet);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      ConfigMasterPopulatorsFactoryBean other = (ConfigMasterPopulatorsFactoryBean) obj;
      return JodaBeanUtils.equal(getConfigMaster(), other.getConfigMaster()) &&
          JodaBeanUtils.equal(isYieldCurve(), other.isYieldCurve()) &&
          JodaBeanUtils.equal(isCurrencyMatrix(), other.isCurrencyMatrix()) &&
          JodaBeanUtils.equal(isSwaptionVolatilitySurface(), other.isSwaptionVolatilitySurface()) &&
          JodaBeanUtils.equal(isIrFutureOptionSurface(), other.isIrFutureOptionSurface()) &&
          JodaBeanUtils.equal(isFxOptionVolatilitySurface(), other.isFxOptionVolatilitySurface()) &&
          JodaBeanUtils.equal(isEquityOptionSurface(), other.isEquityOptionSurface()) &&
          JodaBeanUtils.equal(isVolatilityCube(), other.isVolatilityCube()) &&
          JodaBeanUtils.equal(isFxForwardCurve(), other.isFxForwardCurve()) &&
          JodaBeanUtils.equal(isCurveCalculationConfiguration(), other.isCurveCalculationConfiguration());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = getClass().hashCode();
    hash += hash * 31 + JodaBeanUtils.hashCode(getConfigMaster());
    hash += hash * 31 + JodaBeanUtils.hashCode(isYieldCurve());
    hash += hash * 31 + JodaBeanUtils.hashCode(isCurrencyMatrix());
    hash += hash * 31 + JodaBeanUtils.hashCode(isSwaptionVolatilitySurface());
    hash += hash * 31 + JodaBeanUtils.hashCode(isIrFutureOptionSurface());
    hash += hash * 31 + JodaBeanUtils.hashCode(isFxOptionVolatilitySurface());
    hash += hash * 31 + JodaBeanUtils.hashCode(isEquityOptionSurface());
    hash += hash * 31 + JodaBeanUtils.hashCode(isVolatilityCube());
    hash += hash * 31 + JodaBeanUtils.hashCode(isFxForwardCurve());
    hash += hash * 31 + JodaBeanUtils.hashCode(isCurveCalculationConfiguration());
    return hash;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the config master.
   * @return the value of the property
   */
  public ConfigMaster getConfigMaster() {
    return _configMaster;
  }

  /**
   * Sets the config master.
   * @param configMaster  the new value of the property
   */
  public void setConfigMaster(ConfigMaster configMaster) {
    this._configMaster = configMaster;
  }

  /**
   * Gets the the {@code configMaster} property.
   * @return the property, not null
   */
  public final Property<ConfigMaster> configMaster() {
    return metaBean().configMaster().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the yield curves in the config master.
   * @return the value of the property
   */
  public boolean isYieldCurve() {
    return _yieldCurve;
  }

  /**
   * Sets the flag to create the yield curves in the config master.
   * @param yieldCurve  the new value of the property
   */
  public void setYieldCurve(boolean yieldCurve) {
    this._yieldCurve = yieldCurve;
  }

  /**
   * Gets the the {@code yieldCurve} property.
   * @return the property, not null
   */
  public final Property<Boolean> yieldCurve() {
    return metaBean().yieldCurve().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the currency matrix in the config master.
   * @return the value of the property
   */
  public boolean isCurrencyMatrix() {
    return _currencyMatrix;
  }

  /**
   * Sets the flag to create the currency matrix in the config master.
   * @param currencyMatrix  the new value of the property
   */
  public void setCurrencyMatrix(boolean currencyMatrix) {
    this._currencyMatrix = currencyMatrix;
  }

  /**
   * Gets the the {@code currencyMatrix} property.
   * @return the property, not null
   */
  public final Property<Boolean> currencyMatrix() {
    return metaBean().currencyMatrix().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the surfaces in the config master.
   * @return the value of the property
   */
  public boolean isSwaptionVolatilitySurface() {
    return _swaptionVolatilitySurface;
  }

  /**
   * Sets the flag to create the surfaces in the config master.
   * @param swaptionVolatilitySurface  the new value of the property
   */
  public void setSwaptionVolatilitySurface(boolean swaptionVolatilitySurface) {
    this._swaptionVolatilitySurface = swaptionVolatilitySurface;
  }

  /**
   * Gets the the {@code swaptionVolatilitySurface} property.
   * @return the property, not null
   */
  public final Property<Boolean> swaptionVolatilitySurface() {
    return metaBean().swaptionVolatilitySurface().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the surfaces in the config master.
   * @return the value of the property
   */
  public boolean isIrFutureOptionSurface() {
    return _irFutureOptionSurface;
  }

  /**
   * Sets the flag to create the surfaces in the config master.
   * @param irFutureOptionSurface  the new value of the property
   */
  public void setIrFutureOptionSurface(boolean irFutureOptionSurface) {
    this._irFutureOptionSurface = irFutureOptionSurface;
  }

  /**
   * Gets the the {@code irFutureOptionSurface} property.
   * @return the property, not null
   */
  public final Property<Boolean> irFutureOptionSurface() {
    return metaBean().irFutureOptionSurface().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the surfaces in the config master.
   * @return the value of the property
   */
  public boolean isFxOptionVolatilitySurface() {
    return _fxOptionVolatilitySurface;
  }

  /**
   * Sets the flag to create the surfaces in the config master.
   * @param fxOptionVolatilitySurface  the new value of the property
   */
  public void setFxOptionVolatilitySurface(boolean fxOptionVolatilitySurface) {
    this._fxOptionVolatilitySurface = fxOptionVolatilitySurface;
  }

  /**
   * Gets the the {@code fxOptionVolatilitySurface} property.
   * @return the property, not null
   */
  public final Property<Boolean> fxOptionVolatilitySurface() {
    return metaBean().fxOptionVolatilitySurface().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the surfaces in the config master.
   * @return the value of the property
   */
  public boolean isEquityOptionSurface() {
    return _equityOptionSurface;
  }

  /**
   * Sets the flag to create the surfaces in the config master.
   * @param equityOptionSurface  the new value of the property
   */
  public void setEquityOptionSurface(boolean equityOptionSurface) {
    this._equityOptionSurface = equityOptionSurface;
  }

  /**
   * Gets the the {@code equityOptionSurface} property.
   * @return the property, not null
   */
  public final Property<Boolean> equityOptionSurface() {
    return metaBean().equityOptionSurface().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the volatility cubes in the config master.
   * @return the value of the property
   */
  public boolean isVolatilityCube() {
    return _volatilityCube;
  }

  /**
   * Sets the flag to create the volatility cubes in the config master.
   * @param volatilityCube  the new value of the property
   */
  public void setVolatilityCube(boolean volatilityCube) {
    this._volatilityCube = volatilityCube;
  }

  /**
   * Gets the the {@code volatilityCube} property.
   * @return the property, not null
   */
  public final Property<Boolean> volatilityCube() {
    return metaBean().volatilityCube().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create the FX forward curves in the config master.
   * @return the value of the property
   */
  public boolean isFxForwardCurve() {
    return _fxForwardCurve;
  }

  /**
   * Sets the flag to create the FX forward curves in the config master.
   * @param fxForwardCurve  the new value of the property
   */
  public void setFxForwardCurve(boolean fxForwardCurve) {
    this._fxForwardCurve = fxForwardCurve;
  }

  /**
   * Gets the the {@code fxForwardCurve} property.
   * @return the property, not null
   */
  public final Property<Boolean> fxForwardCurve() {
    return metaBean().fxForwardCurve().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the flag to create curve calculation configurations in the config master.
   * @return the value of the property
   */
  public boolean isCurveCalculationConfiguration() {
    return _curveCalculationConfiguration;
  }

  /**
   * Sets the flag to create curve calculation configurations in the config master.
   * @param curveCalculationConfiguration  the new value of the property
   */
  public void setCurveCalculationConfiguration(boolean curveCalculationConfiguration) {
    this._curveCalculationConfiguration = curveCalculationConfiguration;
  }

  /**
   * Gets the the {@code curveCalculationConfiguration} property.
   * @return the property, not null
   */
  public final Property<Boolean> curveCalculationConfiguration() {
    return metaBean().curveCalculationConfiguration().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * The meta-bean for {@code ConfigMasterPopulatorsFactoryBean}.
   */
  public static class Meta extends DirectMetaBean {
    /**
     * The singleton instance of the meta-bean.
     */
    static final Meta INSTANCE = new Meta();

    /**
     * The meta-property for the {@code configMaster} property.
     */
    private final MetaProperty<ConfigMaster> _configMaster = DirectMetaProperty.ofReadWrite(
        this, "configMaster", ConfigMasterPopulatorsFactoryBean.class, ConfigMaster.class);
    /**
     * The meta-property for the {@code yieldCurve} property.
     */
    private final MetaProperty<Boolean> _yieldCurve = DirectMetaProperty.ofReadWrite(
        this, "yieldCurve", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code currencyMatrix} property.
     */
    private final MetaProperty<Boolean> _currencyMatrix = DirectMetaProperty.ofReadWrite(
        this, "currencyMatrix", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code swaptionVolatilitySurface} property.
     */
    private final MetaProperty<Boolean> _swaptionVolatilitySurface = DirectMetaProperty.ofReadWrite(
        this, "swaptionVolatilitySurface", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code irFutureOptionSurface} property.
     */
    private final MetaProperty<Boolean> _irFutureOptionSurface = DirectMetaProperty.ofReadWrite(
        this, "irFutureOptionSurface", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code fxOptionVolatilitySurface} property.
     */
    private final MetaProperty<Boolean> _fxOptionVolatilitySurface = DirectMetaProperty.ofReadWrite(
        this, "fxOptionVolatilitySurface", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code equityOptionSurface} property.
     */
    private final MetaProperty<Boolean> _equityOptionSurface = DirectMetaProperty.ofReadWrite(
        this, "equityOptionSurface", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code volatilityCube} property.
     */
    private final MetaProperty<Boolean> _volatilityCube = DirectMetaProperty.ofReadWrite(
        this, "volatilityCube", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code fxForwardCurve} property.
     */
    private final MetaProperty<Boolean> _fxForwardCurve = DirectMetaProperty.ofReadWrite(
        this, "fxForwardCurve", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-property for the {@code curveCalculationConfiguration} property.
     */
    private final MetaProperty<Boolean> _curveCalculationConfiguration = DirectMetaProperty.ofReadWrite(
        this, "curveCalculationConfiguration", ConfigMasterPopulatorsFactoryBean.class, Boolean.TYPE);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
        this, null,
        "configMaster",
        "yieldCurve",
        "currencyMatrix",
        "swaptionVolatilitySurface",
        "irFutureOptionSurface",
        "fxOptionVolatilitySurface",
        "equityOptionSurface",
        "volatilityCube",
        "fxForwardCurve",
        "curveCalculationConfiguration");

    /**
     * Restricted constructor.
     */
    protected Meta() {
    }

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case 10395716// configMaster
          return _configMaster;
        case 1112236386// yieldCurve
          return _yieldCurve;
        case -506174670// currencyMatrix
          return _currencyMatrix;
        case -1209267103// swaptionVolatilitySurface
          return _swaptionVolatilitySurface;
        case -1409170036// irFutureOptionSurface
          return _irFutureOptionSurface;
        case -973280351// fxOptionVolatilitySurface
          return _fxOptionVolatilitySurface;
        case 1198258099// equityOptionSurface
          return _equityOptionSurface;
        case 69583354// volatilityCube
          return _volatilityCube;
        case -1016191204// fxForwardCurve
          return _fxForwardCurve;
        case 364174524// curveCalculationConfiguration
          return _curveCalculationConfiguration;
      }
      return super.metaPropertyGet(propertyName);
    }

    @Override
    public BeanBuilder<? extends ConfigMasterPopulatorsFactoryBean> builder() {
      return new DirectBeanBuilder<ConfigMasterPopulatorsFactoryBean>(new ConfigMasterPopulatorsFactoryBean());
    }

    @Override
    public Class<? extends ConfigMasterPopulatorsFactoryBean> beanType() {
      return ConfigMasterPopulatorsFactoryBean.class;
    }

    @Override
    public Map<String, MetaProperty<?>> metaPropertyMap() {
      return _metaPropertyMap$;
    }

    //-----------------------------------------------------------------------
    /**
     * The meta-property for the {@code configMaster} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<ConfigMaster> configMaster() {
      return _configMaster;
    }

    /**
     * The meta-property for the {@code yieldCurve} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> yieldCurve() {
      return _yieldCurve;
    }

    /**
     * The meta-property for the {@code currencyMatrix} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> currencyMatrix() {
      return _currencyMatrix;
    }

    /**
     * The meta-property for the {@code swaptionVolatilitySurface} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> swaptionVolatilitySurface() {
      return _swaptionVolatilitySurface;
    }

    /**
     * The meta-property for the {@code irFutureOptionSurface} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> irFutureOptionSurface() {
      return _irFutureOptionSurface;
    }

    /**
     * The meta-property for the {@code fxOptionVolatilitySurface} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> fxOptionVolatilitySurface() {
      return _fxOptionVolatilitySurface;
    }

    /**
     * The meta-property for the {@code equityOptionSurface} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> equityOptionSurface() {
      return _equityOptionSurface;
    }

    /**
     * The meta-property for the {@code volatilityCube} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> volatilityCube() {
      return _volatilityCube;
    }

    /**
     * The meta-property for the {@code fxForwardCurve} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> fxForwardCurve() {
      return _fxForwardCurve;
    }

    /**
     * The meta-property for the {@code curveCalculationConfiguration} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Boolean> curveCalculationConfiguration() {
      return _curveCalculationConfiguration;
    }

  }

  ///CLOVER:ON
  //-------------------------- AUTOGENERATED END --------------------------
}
TOP

Related Classes of com.opengamma.financial.spring.ConfigMasterPopulatorsFactoryBean$Meta

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.