/** * 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.Map; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import org.joda.beans.Bean; 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.DirectBeanBuilder; import org.joda.beans.impl.direct.DirectMetaProperty; import org.joda.beans.impl.direct.DirectMetaPropertyMap; import org.threeten.bp.LocalDate; import com.opengamma.integration.tool.portfolio.xml.v1_0.conversion.FraTradeSecurityExtractor; import com.opengamma.util.money.Currency; /** * JAXB representation of a Fra trade. */ @XmlRootElement @BeanDefinition public class FraTrade extends Trade { @XmlElement(name = "payFixed", required = true) @PropertyDefinition private boolean _payFixed; @XmlElement(name = "effectiveDate", required = true) @PropertyDefinition private LocalDate _effectiveDate; @XmlElement(name = "paymentDate", required = false) @PropertyDefinition private LocalDate _paymentDate; @XmlElement(name = "fixingDate", required = true) @PropertyDefinition private LocalDate _fixingDate; @XmlElement(name = "regionId", required = true) @PropertyDefinition private IdWrapper _regionId; @XmlElement(name = "terminationDate", required = true) @PropertyDefinition private LocalDate _terminationDate; @XmlElement(name = "currency", required = true) @PropertyDefinition private Currency _currency; @XmlElement(name = "notional", required = true) @PropertyDefinition private BigDecimal _notional; @XmlElement(name = "rate", required = true) @PropertyDefinition private BigDecimal _rate; @XmlElement(name = "businessDayConvention", required = false) @PropertyDefinition private String _businessDayConvention; @XmlElement(name = "dayCount", required = false) @PropertyDefinition private String _dayCount; @XmlElement(name = "fixingIndex", required = true) @PropertyDefinition private FixingIndex _fixingIndex; @Override public boolean canBePositionAggregated() { return false; } @Override public FraTradeSecurityExtractor getSecurityExtractor() { return new FraTradeSecurityExtractor(this); } //------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF /** * The meta-bean for {@code FraTrade}. * @return the meta-bean, not null */ public static FraTrade.Meta meta() { return FraTrade.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(FraTrade.Meta.INSTANCE); } @Override public FraTrade.Meta metaBean() { return FraTrade.Meta.INSTANCE; } //----------------------------------------------------------------------- /** * Gets the payFixed. * @return the value of the property */ public boolean isPayFixed() { return _payFixed; } /** * Sets the payFixed. * @param payFixed the new value of the property */ public void setPayFixed(boolean payFixed) { this._payFixed = payFixed; } /** * Gets the the {@code payFixed} property. * @return the property, not null */ public final Property<Boolean> payFixed() { return metaBean().payFixed().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the effectiveDate. * @return the value of the property */ public LocalDate getEffectiveDate() { return _effectiveDate; } /** * Sets the effectiveDate. * @param effectiveDate the new value of the property */ public void setEffectiveDate(LocalDate effectiveDate) { this._effectiveDate = effectiveDate; } /** * Gets the the {@code effectiveDate} property. * @return the property, not null */ public final Property<LocalDate> effectiveDate() { return metaBean().effectiveDate().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the paymentDate. * @return the value of the property */ public LocalDate getPaymentDate() { return _paymentDate; } /** * Sets the paymentDate. * @param paymentDate the new value of the property */ public void setPaymentDate(LocalDate paymentDate) { this._paymentDate = paymentDate; } /** * Gets the the {@code paymentDate} property. * @return the property, not null */ public final Property<LocalDate> paymentDate() { return metaBean().paymentDate().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the fixingDate. * @return the value of the property */ public LocalDate getFixingDate() { return _fixingDate; } /** * Sets the fixingDate. * @param fixingDate the new value of the property */ public void setFixingDate(LocalDate fixingDate) { this._fixingDate = fixingDate; } /** * Gets the the {@code fixingDate} property. * @return the property, not null */ public final Property<LocalDate> fixingDate() { return metaBean().fixingDate().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the regionId. * @return the value of the property */ public IdWrapper getRegionId() { return _regionId; } /** * Sets the regionId. * @param regionId the new value of the property */ public void setRegionId(IdWrapper regionId) { this._regionId = regionId; } /** * Gets the the {@code regionId} property. * @return the property, not null */ public final Property<IdWrapper> regionId() { return metaBean().regionId().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the terminationDate. * @return the value of the property */ public LocalDate getTerminationDate() { return _terminationDate; } /** * Sets the terminationDate. * @param terminationDate the new value of the property */ public void setTerminationDate(LocalDate terminationDate) { this._terminationDate = terminationDate; } /** * Gets the the {@code terminationDate} property. * @return the property, not null */ public final Property<LocalDate> terminationDate() { return metaBean().terminationDate().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the currency. * @return the value of the property */ public Currency getCurrency() { return _currency; } /** * Sets the currency. * @param currency the new value of the property */ public void setCurrency(Currency currency) { this._currency = currency; } /** * Gets the the {@code currency} property. * @return the property, not null */ public final Property<Currency> currency() { return metaBean().currency().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the notional. * @return the value of the property */ public BigDecimal getNotional() { return _notional; } /** * Sets the notional. * @param notional the new value of the property */ public void setNotional(BigDecimal notional) { this._notional = notional; } /** * Gets the the {@code notional} property. * @return the property, not null */ public final Property<BigDecimal> notional() { return metaBean().notional().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the rate. * @return the value of the property */ public BigDecimal getRate() { return _rate; } /** * Sets the rate. * @param rate the new value of the property */ public void setRate(BigDecimal rate) { this._rate = rate; } /** * Gets the the {@code rate} property. * @return the property, not null */ public final Property<BigDecimal> rate() { return metaBean().rate().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the businessDayConvention. * @return the value of the property */ public String getBusinessDayConvention() { return _businessDayConvention; } /** * Sets the businessDayConvention. * @param businessDayConvention the new value of the property */ public void setBusinessDayConvention(String businessDayConvention) { this._businessDayConvention = businessDayConvention; } /** * Gets the the {@code businessDayConvention} property. * @return the property, not null */ public final Property<String> businessDayConvention() { return metaBean().businessDayConvention().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the dayCount. * @return the value of the property */ public String getDayCount() { return _dayCount; } /** * Sets the dayCount. * @param dayCount the new value of the property */ public void setDayCount(String dayCount) { this._dayCount = dayCount; } /** * Gets the the {@code dayCount} property. * @return the property, not null */ public final Property<String> dayCount() { return metaBean().dayCount().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the fixingIndex. * @return the value of the property */ public FixingIndex getFixingIndex() { return _fixingIndex; } /** * Sets the fixingIndex. * @param fixingIndex the new value of the property */ public void setFixingIndex(FixingIndex fixingIndex) { this._fixingIndex = fixingIndex; } /** * Gets the the {@code fixingIndex} property. * @return the property, not null */ public final Property<FixingIndex> fixingIndex() { return metaBean().fixingIndex().createProperty(this); } //----------------------------------------------------------------------- @Override public FraTrade clone() { return JodaBeanUtils.cloneAlways(this); } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj != null && obj.getClass() == this.getClass()) { FraTrade other = (FraTrade) obj; return (isPayFixed() == other.isPayFixed()) && JodaBeanUtils.equal(getEffectiveDate(), other.getEffectiveDate()) && JodaBeanUtils.equal(getPaymentDate(), other.getPaymentDate()) && JodaBeanUtils.equal(getFixingDate(), other.getFixingDate()) && JodaBeanUtils.equal(getRegionId(), other.getRegionId()) && JodaBeanUtils.equal(getTerminationDate(), other.getTerminationDate()) && JodaBeanUtils.equal(getCurrency(), other.getCurrency()) && JodaBeanUtils.equal(getNotional(), other.getNotional()) && JodaBeanUtils.equal(getRate(), other.getRate()) && JodaBeanUtils.equal(getBusinessDayConvention(), other.getBusinessDayConvention()) && JodaBeanUtils.equal(getDayCount(), other.getDayCount()) && JodaBeanUtils.equal(getFixingIndex(), other.getFixingIndex()) && super.equals(obj); } return false; } @Override public int hashCode() { int hash = 7; hash = hash * 31 + JodaBeanUtils.hashCode(isPayFixed()); hash = hash * 31 + JodaBeanUtils.hashCode(getEffectiveDate()); hash = hash * 31 + JodaBeanUtils.hashCode(getPaymentDate()); hash = hash * 31 + JodaBeanUtils.hashCode(getFixingDate()); hash = hash * 31 + JodaBeanUtils.hashCode(getRegionId()); hash = hash * 31 + JodaBeanUtils.hashCode(getTerminationDate()); hash = hash * 31 + JodaBeanUtils.hashCode(getCurrency()); hash = hash * 31 + JodaBeanUtils.hashCode(getNotional()); hash = hash * 31 + JodaBeanUtils.hashCode(getRate()); hash = hash * 31 + JodaBeanUtils.hashCode(getBusinessDayConvention()); hash = hash * 31 + JodaBeanUtils.hashCode(getDayCount()); hash = hash * 31 + JodaBeanUtils.hashCode(getFixingIndex()); return hash ^ super.hashCode(); } @Override public String toString() { StringBuilder buf = new StringBuilder(416); buf.append("FraTrade{"); int len = buf.length(); toString(buf); if (buf.length() > len) { buf.setLength(buf.length() - 2); } buf.append('}'); return buf.toString(); } @Override protected void toString(StringBuilder buf) { super.toString(buf); buf.append("payFixed").append('=').append(JodaBeanUtils.toString(isPayFixed())).append(',').append(' '); buf.append("effectiveDate").append('=').append(JodaBeanUtils.toString(getEffectiveDate())).append(',').append(' '); buf.append("paymentDate").append('=').append(JodaBeanUtils.toString(getPaymentDate())).append(',').append(' '); buf.append("fixingDate").append('=').append(JodaBeanUtils.toString(getFixingDate())).append(',').append(' '); buf.append("regionId").append('=').append(JodaBeanUtils.toString(getRegionId())).append(',').append(' '); buf.append("terminationDate").append('=').append(JodaBeanUtils.toString(getTerminationDate())).append(',').append(' '); buf.append("currency").append('=').append(JodaBeanUtils.toString(getCurrency())).append(',').append(' '); buf.append("notional").append('=').append(JodaBeanUtils.toString(getNotional())).append(',').append(' '); buf.append("rate").append('=').append(JodaBeanUtils.toString(getRate())).append(',').append(' '); buf.append("businessDayConvention").append('=').append(JodaBeanUtils.toString(getBusinessDayConvention())).append(',').append(' '); buf.append("dayCount").append('=').append(JodaBeanUtils.toString(getDayCount())).append(',').append(' '); buf.append("fixingIndex").append('=').append(JodaBeanUtils.toString(getFixingIndex())).append(',').append(' '); } //----------------------------------------------------------------------- /** * The meta-bean for {@code FraTrade}. */ 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 payFixed} property. */ private final MetaProperty<Boolean> _payFixed = DirectMetaProperty.ofReadWrite( this, "payFixed", FraTrade.class, Boolean.TYPE); /** * The meta-property for the {@code effectiveDate} property. */ private final MetaProperty<LocalDate> _effectiveDate = DirectMetaProperty.ofReadWrite( this, "effectiveDate", FraTrade.class, LocalDate.class); /** * The meta-property for the {@code paymentDate} property. */ private final MetaProperty<LocalDate> _paymentDate = DirectMetaProperty.ofReadWrite( this, "paymentDate", FraTrade.class, LocalDate.class); /** * The meta-property for the {@code fixingDate} property. */ private final MetaProperty<LocalDate> _fixingDate = DirectMetaProperty.ofReadWrite( this, "fixingDate", FraTrade.class, LocalDate.class); /** * The meta-property for the {@code regionId} property. */ private final MetaProperty<IdWrapper> _regionId = DirectMetaProperty.ofReadWrite( this, "regionId", FraTrade.class, IdWrapper.class); /** * The meta-property for the {@code terminationDate} property. */ private final MetaProperty<LocalDate> _terminationDate = DirectMetaProperty.ofReadWrite( this, "terminationDate", FraTrade.class, LocalDate.class); /** * The meta-property for the {@code currency} property. */ private final MetaProperty<Currency> _currency = DirectMetaProperty.ofReadWrite( this, "currency", FraTrade.class, Currency.class); /** * The meta-property for the {@code notional} property. */ private final MetaProperty<BigDecimal> _notional = DirectMetaProperty.ofReadWrite( this, "notional", FraTrade.class, BigDecimal.class); /** * The meta-property for the {@code rate} property. */ private final MetaProperty<BigDecimal> _rate = DirectMetaProperty.ofReadWrite( this, "rate", FraTrade.class, BigDecimal.class); /** * The meta-property for the {@code businessDayConvention} property. */ private final MetaProperty<String> _businessDayConvention = DirectMetaProperty.ofReadWrite( this, "businessDayConvention", FraTrade.class, String.class); /** * The meta-property for the {@code dayCount} property. */ private final MetaProperty<String> _dayCount = DirectMetaProperty.ofReadWrite( this, "dayCount", FraTrade.class, String.class); /** * The meta-property for the {@code fixingIndex} property. */ private final MetaProperty<FixingIndex> _fixingIndex = DirectMetaProperty.ofReadWrite( this, "fixingIndex", FraTrade.class, FixingIndex.class); /** * The meta-properties. */ private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap( this, (DirectMetaPropertyMap) super.metaPropertyMap(), "payFixed", "effectiveDate", "paymentDate", "fixingDate", "regionId", "terminationDate", "currency", "notional", "rate", "businessDayConvention", "dayCount", "fixingIndex"); /** * Restricted constructor. */ protected Meta() { } @Override protected MetaProperty<?> metaPropertyGet(String propertyName) { switch (propertyName.hashCode()) { case 1346793388: // payFixed return _payFixed; case -930389515: // effectiveDate return _effectiveDate; case -1540873516: // paymentDate return _paymentDate; case 1255202043: // fixingDate return _fixingDate; case -690339025: // regionId return _regionId; case 272763090: // terminationDate return _terminationDate; case 575402001: // currency return _currency; case 1585636160: // notional return _notional; case 3493088: // rate return _rate; case -1002835891: // businessDayConvention return _businessDayConvention; case 1905311443: // dayCount return _dayCount; case 261547301: // fixingIndex return _fixingIndex; } return super.metaPropertyGet(propertyName); } @Override public BeanBuilder<? extends FraTrade> builder() { return new DirectBeanBuilder<FraTrade>(new FraTrade()); } @Override public Class<? extends FraTrade> beanType() { return FraTrade.class; } @Override public Map<String, MetaProperty<?>> metaPropertyMap() { return _metaPropertyMap$; } //----------------------------------------------------------------------- /** * The meta-property for the {@code payFixed} property. * @return the meta-property, not null */ public final MetaProperty<Boolean> payFixed() { return _payFixed; } /** * The meta-property for the {@code effectiveDate} property. * @return the meta-property, not null */ public final MetaProperty<LocalDate> effectiveDate() { return _effectiveDate; } /** * The meta-property for the {@code paymentDate} property. * @return the meta-property, not null */ public final MetaProperty<LocalDate> paymentDate() { return _paymentDate; } /** * The meta-property for the {@code fixingDate} property. * @return the meta-property, not null */ public final MetaProperty<LocalDate> fixingDate() { return _fixingDate; } /** * The meta-property for the {@code regionId} property. * @return the meta-property, not null */ public final MetaProperty<IdWrapper> regionId() { return _regionId; } /** * The meta-property for the {@code terminationDate} property. * @return the meta-property, not null */ public final MetaProperty<LocalDate> terminationDate() { return _terminationDate; } /** * The meta-property for the {@code currency} property. * @return the meta-property, not null */ public final MetaProperty<Currency> currency() { return _currency; } /** * The meta-property for the {@code notional} property. * @return the meta-property, not null */ public final MetaProperty<BigDecimal> notional() { return _notional; } /** * The meta-property for the {@code rate} property. * @return the meta-property, not null */ public final MetaProperty<BigDecimal> rate() { return _rate; } /** * The meta-property for the {@code businessDayConvention} property. * @return the meta-property, not null */ public final MetaProperty<String> businessDayConvention() { return _businessDayConvention; } /** * The meta-property for the {@code dayCount} property. * @return the meta-property, not null */ public final MetaProperty<String> dayCount() { return _dayCount; } /** * The meta-property for the {@code fixingIndex} property. * @return the meta-property, not null */ public final MetaProperty<FixingIndex> fixingIndex() { return _fixingIndex; } //----------------------------------------------------------------------- @Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1346793388: // payFixed return ((FraTrade) bean).isPayFixed(); case -930389515: // effectiveDate return ((FraTrade) bean).getEffectiveDate(); case -1540873516: // paymentDate return ((FraTrade) bean).getPaymentDate(); case 1255202043: // fixingDate return ((FraTrade) bean).getFixingDate(); case -690339025: // regionId return ((FraTrade) bean).getRegionId(); case 272763090: // terminationDate return ((FraTrade) bean).getTerminationDate(); case 575402001: // currency return ((FraTrade) bean).getCurrency(); case 1585636160: // notional return ((FraTrade) bean).getNotional(); case 3493088: // rate return ((FraTrade) bean).getRate(); case -1002835891: // businessDayConvention return ((FraTrade) bean).getBusinessDayConvention(); case 1905311443: // dayCount return ((FraTrade) bean).getDayCount(); case 261547301: // fixingIndex return ((FraTrade) bean).getFixingIndex(); } return super.propertyGet(bean, propertyName, quiet); } @Override protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) { switch (propertyName.hashCode()) { case 1346793388: // payFixed ((FraTrade) bean).setPayFixed((Boolean) newValue); return; case -930389515: // effectiveDate ((FraTrade) bean).setEffectiveDate((LocalDate) newValue); return; case -1540873516: // paymentDate ((FraTrade) bean).setPaymentDate((LocalDate) newValue); return; case 1255202043: // fixingDate ((FraTrade) bean).setFixingDate((LocalDate) newValue); return; case -690339025: // regionId ((FraTrade) bean).setRegionId((IdWrapper) newValue); return; case 272763090: // terminationDate ((FraTrade) bean).setTerminationDate((LocalDate) newValue); return; case 575402001: // currency ((FraTrade) bean).setCurrency((Currency) newValue); return; case 1585636160: // notional ((FraTrade) bean).setNotional((BigDecimal) newValue); return; case 3493088: // rate ((FraTrade) bean).setRate((BigDecimal) newValue); return; case -1002835891: // businessDayConvention ((FraTrade) bean).setBusinessDayConvention((String) newValue); return; case 1905311443: // dayCount ((FraTrade) bean).setDayCount((String) newValue); return; case 261547301: // fixingIndex ((FraTrade) bean).setFixingIndex((FixingIndex) newValue); return; } super.propertySet(bean, propertyName, newValue, quiet); } } ///CLOVER:ON //-------------------------- AUTOGENERATED END -------------------------- }