Package com.opengamma.integration.tool.portfolio.xml.v1_0.jaxb

Source Code of com.opengamma.integration.tool.portfolio.xml.v1_0.jaxb.FxForwardTrade$Meta

/**
* Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.integration.tool.portfolio.xml.v1_0.jaxb;

import java.math.BigDecimal;
import java.util.Set;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;

import org.joda.beans.BeanDefinition;
import org.joda.beans.PropertyDefinition;
import org.threeten.bp.LocalDate;

import com.opengamma.integration.tool.portfolio.xml.v1_0.conversion.FxForwardTradeSecurityExtractor;
import com.opengamma.integration.tool.portfolio.xml.v1_0.conversion.TradeSecurityExtractor;
import com.opengamma.util.money.Currency;
import java.util.Map;
import org.joda.beans.BeanBuilder;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;

@XmlRootElement
@BeanDefinition
public class FxForwardTrade extends Trade {

  @XmlElement(name = "payAmount", required = true)
  @PropertyDefinition
  private BigDecimal _payAmount;

  @XmlElement(name = "payCurrency", required = true)
  @PropertyDefinition
  private Currency _payCurrency;

  @XmlElement(name = "receiveAmount", required = true)
  @PropertyDefinition
  private BigDecimal _receiveAmount;

  @XmlElement(name = "receiveCurrency", required = true)
  @PropertyDefinition
  private Currency _receiveCurrency;

  @XmlElement(name = "settlementCurrency")
  @PropertyDefinition
  private Currency _settlementCurrency;

  @XmlElement(name = "fxExpiry")
  @PropertyDefinition
  private FxExpiry _fxExpiry;

  @XmlElementWrapper(name = "paymentCalendars")
  @XmlElement(name = "calendar")
  @PropertyDefinition
  private Set<Calendar> _paymentCalendars;

  @Override
  public boolean canBePositionAggregated() {
    return false;
  }

  @Override
  public TradeSecurityExtractor getSecurityExtractor() {
    return new FxForwardTradeSecurityExtractor(this);
  }

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

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

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

  @Override
  protected Object propertyGet(String propertyName, boolean quiet) {
    switch (propertyName.hashCode()) {
      case -1338781920// payAmount
        return getPayAmount();
      case -295641895// payCurrency
        return getPayCurrency();
      case 984267035// receiveAmount
        return getReceiveAmount();
      case -1228590060// receiveCurrency
        return getReceiveCurrency();
      case -1024875430// settlementCurrency
        return getSettlementCurrency();
      case -1406037851// fxExpiry
        return getFxExpiry();
      case -299417201// paymentCalendars
        return getPaymentCalendars();
    }
    return super.propertyGet(propertyName, quiet);
  }

  @SuppressWarnings("unchecked")
  @Override
  protected void propertySet(String propertyName, Object newValue, boolean quiet) {
    switch (propertyName.hashCode()) {
      case -1338781920// payAmount
        setPayAmount((BigDecimal) newValue);
        return;
      case -295641895// payCurrency
        setPayCurrency((Currency) newValue);
        return;
      case 984267035// receiveAmount
        setReceiveAmount((BigDecimal) newValue);
        return;
      case -1228590060// receiveCurrency
        setReceiveCurrency((Currency) newValue);
        return;
      case -1024875430// settlementCurrency
        setSettlementCurrency((Currency) newValue);
        return;
      case -1406037851// fxExpiry
        setFxExpiry((FxExpiry) newValue);
        return;
      case -299417201// paymentCalendars
        setPaymentCalendars((Set<Calendar>) 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()) {
      FxForwardTrade other = (FxForwardTrade) obj;
      return JodaBeanUtils.equal(getPayAmount(), other.getPayAmount()) &&
          JodaBeanUtils.equal(getPayCurrency(), other.getPayCurrency()) &&
          JodaBeanUtils.equal(getReceiveAmount(), other.getReceiveAmount()) &&
          JodaBeanUtils.equal(getReceiveCurrency(), other.getReceiveCurrency()) &&
          JodaBeanUtils.equal(getSettlementCurrency(), other.getSettlementCurrency()) &&
          JodaBeanUtils.equal(getFxExpiry(), other.getFxExpiry()) &&
          JodaBeanUtils.equal(getPaymentCalendars(), other.getPaymentCalendars()) &&
          super.equals(obj);
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash += hash * 31 + JodaBeanUtils.hashCode(getPayAmount());
    hash += hash * 31 + JodaBeanUtils.hashCode(getPayCurrency());
    hash += hash * 31 + JodaBeanUtils.hashCode(getReceiveAmount());
    hash += hash * 31 + JodaBeanUtils.hashCode(getReceiveCurrency());
    hash += hash * 31 + JodaBeanUtils.hashCode(getSettlementCurrency());
    hash += hash * 31 + JodaBeanUtils.hashCode(getFxExpiry());
    hash += hash * 31 + JodaBeanUtils.hashCode(getPaymentCalendars());
    return hash ^ super.hashCode();
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the payAmount.
   * @return the value of the property
   */
  public BigDecimal getPayAmount() {
    return _payAmount;
  }

  /**
   * Sets the payAmount.
   * @param payAmount  the new value of the property
   */
  public void setPayAmount(BigDecimal payAmount) {
    this._payAmount = payAmount;
  }

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

  //-----------------------------------------------------------------------
  /**
   * Gets the payCurrency.
   * @return the value of the property
   */
  public Currency getPayCurrency() {
    return _payCurrency;
  }

  /**
   * Sets the payCurrency.
   * @param payCurrency  the new value of the property
   */
  public void setPayCurrency(Currency payCurrency) {
    this._payCurrency = payCurrency;
  }

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

  //-----------------------------------------------------------------------
  /**
   * Gets the receiveAmount.
   * @return the value of the property
   */
  public BigDecimal getReceiveAmount() {
    return _receiveAmount;
  }

  /**
   * Sets the receiveAmount.
   * @param receiveAmount  the new value of the property
   */
  public void setReceiveAmount(BigDecimal receiveAmount) {
    this._receiveAmount = receiveAmount;
  }

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

  //-----------------------------------------------------------------------
  /**
   * Gets the receiveCurrency.
   * @return the value of the property
   */
  public Currency getReceiveCurrency() {
    return _receiveCurrency;
  }

  /**
   * Sets the receiveCurrency.
   * @param receiveCurrency  the new value of the property
   */
  public void setReceiveCurrency(Currency receiveCurrency) {
    this._receiveCurrency = receiveCurrency;
  }

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

  //-----------------------------------------------------------------------
  /**
   * Gets the settlementCurrency.
   * @return the value of the property
   */
  public Currency getSettlementCurrency() {
    return _settlementCurrency;
  }

  /**
   * Sets the settlementCurrency.
   * @param settlementCurrency  the new value of the property
   */
  public void setSettlementCurrency(Currency settlementCurrency) {
    this._settlementCurrency = settlementCurrency;
  }

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

  //-----------------------------------------------------------------------
  /**
   * Gets the fxExpiry.
   * @return the value of the property
   */
  public FxExpiry getFxExpiry() {
    return _fxExpiry;
  }

  /**
   * Sets the fxExpiry.
   * @param fxExpiry  the new value of the property
   */
  public void setFxExpiry(FxExpiry fxExpiry) {
    this._fxExpiry = fxExpiry;
  }

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

  //-----------------------------------------------------------------------
  /**
   * Gets the paymentCalendars.
   * @return the value of the property
   */
  public Set<Calendar> getPaymentCalendars() {
    return _paymentCalendars;
  }

  /**
   * Sets the paymentCalendars.
   * @param paymentCalendars  the new value of the property
   */
  public void setPaymentCalendars(Set<Calendar> paymentCalendars) {
    this._paymentCalendars = paymentCalendars;
  }

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

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

    /**
     * The meta-property for the {@code payAmount} property.
     */
    private final MetaProperty<BigDecimal> _payAmount = DirectMetaProperty.ofReadWrite(
        this, "payAmount", FxForwardTrade.class, BigDecimal.class);
    /**
     * The meta-property for the {@code payCurrency} property.
     */
    private final MetaProperty<Currency> _payCurrency = DirectMetaProperty.ofReadWrite(
        this, "payCurrency", FxForwardTrade.class, Currency.class);
    /**
     * The meta-property for the {@code receiveAmount} property.
     */
    private final MetaProperty<BigDecimal> _receiveAmount = DirectMetaProperty.ofReadWrite(
        this, "receiveAmount", FxForwardTrade.class, BigDecimal.class);
    /**
     * The meta-property for the {@code receiveCurrency} property.
     */
    private final MetaProperty<Currency> _receiveCurrency = DirectMetaProperty.ofReadWrite(
        this, "receiveCurrency", FxForwardTrade.class, Currency.class);
    /**
     * The meta-property for the {@code settlementCurrency} property.
     */
    private final MetaProperty<Currency> _settlementCurrency = DirectMetaProperty.ofReadWrite(
        this, "settlementCurrency", FxForwardTrade.class, Currency.class);
    /**
     * The meta-property for the {@code fxExpiry} property.
     */
    private final MetaProperty<FxExpiry> _fxExpiry = DirectMetaProperty.ofReadWrite(
        this, "fxExpiry", FxForwardTrade.class, FxExpiry.class);
    /**
     * The meta-property for the {@code paymentCalendars} property.
     */
    @SuppressWarnings({"unchecked", "rawtypes" })
    private final MetaProperty<Set<Calendar>> _paymentCalendars = DirectMetaProperty.ofReadWrite(
        this, "paymentCalendars", FxForwardTrade.class, (Class) Set.class);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
        this, (DirectMetaPropertyMap) super.metaPropertyMap(),
        "payAmount",
        "payCurrency",
        "receiveAmount",
        "receiveCurrency",
        "settlementCurrency",
        "fxExpiry",
        "paymentCalendars");

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

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case -1338781920// payAmount
          return _payAmount;
        case -295641895// payCurrency
          return _payCurrency;
        case 984267035// receiveAmount
          return _receiveAmount;
        case -1228590060// receiveCurrency
          return _receiveCurrency;
        case -1024875430// settlementCurrency
          return _settlementCurrency;
        case -1406037851// fxExpiry
          return _fxExpiry;
        case -299417201// paymentCalendars
          return _paymentCalendars;
      }
      return super.metaPropertyGet(propertyName);
    }

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

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

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

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

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

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

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

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

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

    /**
     * The meta-property for the {@code paymentCalendars} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<Set<Calendar>> paymentCalendars() {
      return _paymentCalendars;
    }

  }

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

Related Classes of com.opengamma.integration.tool.portfolio.xml.v1_0.jaxb.FxForwardTrade$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.