/**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.masterdb.security.hibernate.option;
import java.util.Map;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
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 com.opengamma.financial.security.option.NonDeliverableFXOptionSecurity;
import com.opengamma.masterdb.security.hibernate.CurrencyBean;
import com.opengamma.masterdb.security.hibernate.ExpiryBean;
import com.opengamma.masterdb.security.hibernate.SecurityBean;
import com.opengamma.masterdb.security.hibernate.ZonedDateTimeBean;
/**
* A Hibernate bean representation of {@link NonDeliverableFXOptionSecurity}.
*/
@BeanDefinition
public class NonDeliverableFXOptionSecurityBean extends SecurityBean {
@PropertyDefinition
private double _putAmount;
@PropertyDefinition
private double _callAmount;
@PropertyDefinition
private ExpiryBean _expiry;
@PropertyDefinition
private CurrencyBean _putCurrency;
@PropertyDefinition
private CurrencyBean _callCurrency;
@PropertyDefinition
private ZonedDateTimeBean _settlementDate;
@PropertyDefinition
private Boolean _isLong;
@PropertyDefinition
private OptionExerciseType _optionExerciseType;
@PropertyDefinition
private Boolean _isDeliveryInCallCurrency;
public NonDeliverableFXOptionSecurityBean() {
super();
}
//-----------------------------------------------------------------
@Override
public boolean equals(final Object other) {
if (!(other instanceof NonDeliverableFXOptionSecurityBean)) {
return false;
}
final NonDeliverableFXOptionSecurityBean option = (NonDeliverableFXOptionSecurityBean) other;
return new EqualsBuilder()
.append(getId(), option.getId())
.append(getExpiry(), option.getExpiry())
.append(getPutCurrency(), option.getPutCurrency())
.append(getCallCurrency(), option.getCallCurrency())
.append(getCallAmount(), option.getCallAmount())
.append(getPutAmount(), option.getPutAmount())
.append(getSettlementDate(), option.getSettlementDate())
.append(getIsLong(), option.getIsLong())
.append(getIsDeliveryInCallCurrency(), option.getIsDeliveryInCallCurrency())
.isEquals();
}
//-----------------------------------------------------------------
@Override
public int hashCode() {
return new HashCodeBuilder()
.append(getExpiry())
.append(getPutCurrency())
.append(getCallCurrency())
.append(getSettlementDate())
.append(getPutAmount())
.append(getCallAmount())
.append(getIsLong())
.append(getIsDeliveryInCallCurrency())
.toHashCode();
}
//-----------------------------------------------------------------
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
//------------------------- AUTOGENERATED START -------------------------
///CLOVER:OFF
/**
* The meta-bean for {@code NonDeliverableFXOptionSecurityBean}.
* @return the meta-bean, not null
*/
public static NonDeliverableFXOptionSecurityBean.Meta meta() {
return NonDeliverableFXOptionSecurityBean.Meta.INSTANCE;
}
static {
JodaBeanUtils.registerMetaBean(NonDeliverableFXOptionSecurityBean.Meta.INSTANCE);
}
@Override
public NonDeliverableFXOptionSecurityBean.Meta metaBean() {
return NonDeliverableFXOptionSecurityBean.Meta.INSTANCE;
}
//-----------------------------------------------------------------------
/**
* Gets the putAmount.
* @return the value of the property
*/
public double getPutAmount() {
return _putAmount;
}
/**
* Sets the putAmount.
* @param putAmount the new value of the property
*/
public void setPutAmount(double putAmount) {
this._putAmount = putAmount;
}
/**
* Gets the the {@code putAmount} property.
* @return the property, not null
*/
public final Property<Double> putAmount() {
return metaBean().putAmount().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the callAmount.
* @return the value of the property
*/
public double getCallAmount() {
return _callAmount;
}
/**
* Sets the callAmount.
* @param callAmount the new value of the property
*/
public void setCallAmount(double callAmount) {
this._callAmount = callAmount;
}
/**
* Gets the the {@code callAmount} property.
* @return the property, not null
*/
public final Property<Double> callAmount() {
return metaBean().callAmount().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the expiry.
* @return the value of the property
*/
public ExpiryBean getExpiry() {
return _expiry;
}
/**
* Sets the expiry.
* @param expiry the new value of the property
*/
public void setExpiry(ExpiryBean expiry) {
this._expiry = expiry;
}
/**
* Gets the the {@code expiry} property.
* @return the property, not null
*/
public final Property<ExpiryBean> expiry() {
return metaBean().expiry().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the putCurrency.
* @return the value of the property
*/
public CurrencyBean getPutCurrency() {
return _putCurrency;
}
/**
* Sets the putCurrency.
* @param putCurrency the new value of the property
*/
public void setPutCurrency(CurrencyBean putCurrency) {
this._putCurrency = putCurrency;
}
/**
* Gets the the {@code putCurrency} property.
* @return the property, not null
*/
public final Property<CurrencyBean> putCurrency() {
return metaBean().putCurrency().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the callCurrency.
* @return the value of the property
*/
public CurrencyBean getCallCurrency() {
return _callCurrency;
}
/**
* Sets the callCurrency.
* @param callCurrency the new value of the property
*/
public void setCallCurrency(CurrencyBean callCurrency) {
this._callCurrency = callCurrency;
}
/**
* Gets the the {@code callCurrency} property.
* @return the property, not null
*/
public final Property<CurrencyBean> callCurrency() {
return metaBean().callCurrency().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the settlementDate.
* @return the value of the property
*/
public ZonedDateTimeBean getSettlementDate() {
return _settlementDate;
}
/**
* Sets the settlementDate.
* @param settlementDate the new value of the property
*/
public void setSettlementDate(ZonedDateTimeBean settlementDate) {
this._settlementDate = settlementDate;
}
/**
* Gets the the {@code settlementDate} property.
* @return the property, not null
*/
public final Property<ZonedDateTimeBean> settlementDate() {
return metaBean().settlementDate().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the isLong.
* @return the value of the property
*/
public Boolean getIsLong() {
return _isLong;
}
/**
* Sets the isLong.
* @param isLong the new value of the property
*/
public void setIsLong(Boolean isLong) {
this._isLong = isLong;
}
/**
* Gets the the {@code isLong} property.
* @return the property, not null
*/
public final Property<Boolean> isLong() {
return metaBean().isLong().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the optionExerciseType.
* @return the value of the property
*/
public OptionExerciseType getOptionExerciseType() {
return _optionExerciseType;
}
/**
* Sets the optionExerciseType.
* @param optionExerciseType the new value of the property
*/
public void setOptionExerciseType(OptionExerciseType optionExerciseType) {
this._optionExerciseType = optionExerciseType;
}
/**
* Gets the the {@code optionExerciseType} property.
* @return the property, not null
*/
public final Property<OptionExerciseType> optionExerciseType() {
return metaBean().optionExerciseType().createProperty(this);
}
//-----------------------------------------------------------------------
/**
* Gets the isDeliveryInCallCurrency.
* @return the value of the property
*/
public Boolean getIsDeliveryInCallCurrency() {
return _isDeliveryInCallCurrency;
}
/**
* Sets the isDeliveryInCallCurrency.
* @param isDeliveryInCallCurrency the new value of the property
*/
public void setIsDeliveryInCallCurrency(Boolean isDeliveryInCallCurrency) {
this._isDeliveryInCallCurrency = isDeliveryInCallCurrency;
}
/**
* Gets the the {@code isDeliveryInCallCurrency} property.
* @return the property, not null
*/
public final Property<Boolean> isDeliveryInCallCurrency() {
return metaBean().isDeliveryInCallCurrency().createProperty(this);
}
//-----------------------------------------------------------------------
@Override
public NonDeliverableFXOptionSecurityBean clone() {
return JodaBeanUtils.cloneAlways(this);
}
//-----------------------------------------------------------------------
/**
* The meta-bean for {@code NonDeliverableFXOptionSecurityBean}.
*/
public static class Meta extends SecurityBean.Meta {
/**
* The singleton instance of the meta-bean.
*/
static final Meta INSTANCE = new Meta();
/**
* The meta-property for the {@code putAmount} property.
*/
private final MetaProperty<Double> _putAmount = DirectMetaProperty.ofReadWrite(
this, "putAmount", NonDeliverableFXOptionSecurityBean.class, Double.TYPE);
/**
* The meta-property for the {@code callAmount} property.
*/
private final MetaProperty<Double> _callAmount = DirectMetaProperty.ofReadWrite(
this, "callAmount", NonDeliverableFXOptionSecurityBean.class, Double.TYPE);
/**
* The meta-property for the {@code expiry} property.
*/
private final MetaProperty<ExpiryBean> _expiry = DirectMetaProperty.ofReadWrite(
this, "expiry", NonDeliverableFXOptionSecurityBean.class, ExpiryBean.class);
/**
* The meta-property for the {@code putCurrency} property.
*/
private final MetaProperty<CurrencyBean> _putCurrency = DirectMetaProperty.ofReadWrite(
this, "putCurrency", NonDeliverableFXOptionSecurityBean.class, CurrencyBean.class);
/**
* The meta-property for the {@code callCurrency} property.
*/
private final MetaProperty<CurrencyBean> _callCurrency = DirectMetaProperty.ofReadWrite(
this, "callCurrency", NonDeliverableFXOptionSecurityBean.class, CurrencyBean.class);
/**
* The meta-property for the {@code settlementDate} property.
*/
private final MetaProperty<ZonedDateTimeBean> _settlementDate = DirectMetaProperty.ofReadWrite(
this, "settlementDate", NonDeliverableFXOptionSecurityBean.class, ZonedDateTimeBean.class);
/**
* The meta-property for the {@code isLong} property.
*/
private final MetaProperty<Boolean> _isLong = DirectMetaProperty.ofReadWrite(
this, "isLong", NonDeliverableFXOptionSecurityBean.class, Boolean.class);
/**
* The meta-property for the {@code optionExerciseType} property.
*/
private final MetaProperty<OptionExerciseType> _optionExerciseType = DirectMetaProperty.ofReadWrite(
this, "optionExerciseType", NonDeliverableFXOptionSecurityBean.class, OptionExerciseType.class);
/**
* The meta-property for the {@code isDeliveryInCallCurrency} property.
*/
private final MetaProperty<Boolean> _isDeliveryInCallCurrency = DirectMetaProperty.ofReadWrite(
this, "isDeliveryInCallCurrency", NonDeliverableFXOptionSecurityBean.class, Boolean.class);
/**
* The meta-properties.
*/
private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
this, (DirectMetaPropertyMap) super.metaPropertyMap(),
"putAmount",
"callAmount",
"expiry",
"putCurrency",
"callCurrency",
"settlementDate",
"isLong",
"optionExerciseType",
"isDeliveryInCallCurrency");
/**
* Restricted constructor.
*/
protected Meta() {
}
@Override
protected MetaProperty<?> metaPropertyGet(String propertyName) {
switch (propertyName.hashCode()) {
case -984864697: // putAmount
return _putAmount;
case 1066661974: // callAmount
return _callAmount;
case -1289159373: // expiry
return _expiry;
case 516393024: // putCurrency
return _putCurrency;
case 643534991: // callCurrency
return _callCurrency;
case -295948169: // settlementDate
return _settlementDate;
case -1180327226: // isLong
return _isLong;
case -266326457: // optionExerciseType
return _optionExerciseType;
case -426676942: // isDeliveryInCallCurrency
return _isDeliveryInCallCurrency;
}
return super.metaPropertyGet(propertyName);
}
@Override
public BeanBuilder<? extends NonDeliverableFXOptionSecurityBean> builder() {
return new DirectBeanBuilder<NonDeliverableFXOptionSecurityBean>(new NonDeliverableFXOptionSecurityBean());
}
@Override
public Class<? extends NonDeliverableFXOptionSecurityBean> beanType() {
return NonDeliverableFXOptionSecurityBean.class;
}
@Override
public Map<String, MetaProperty<?>> metaPropertyMap() {
return _metaPropertyMap$;
}
//-----------------------------------------------------------------------
/**
* The meta-property for the {@code putAmount} property.
* @return the meta-property, not null
*/
public final MetaProperty<Double> putAmount() {
return _putAmount;
}
/**
* The meta-property for the {@code callAmount} property.
* @return the meta-property, not null
*/
public final MetaProperty<Double> callAmount() {
return _callAmount;
}
/**
* The meta-property for the {@code expiry} property.
* @return the meta-property, not null
*/
public final MetaProperty<ExpiryBean> expiry() {
return _expiry;
}
/**
* The meta-property for the {@code putCurrency} property.
* @return the meta-property, not null
*/
public final MetaProperty<CurrencyBean> putCurrency() {
return _putCurrency;
}
/**
* The meta-property for the {@code callCurrency} property.
* @return the meta-property, not null
*/
public final MetaProperty<CurrencyBean> callCurrency() {
return _callCurrency;
}
/**
* The meta-property for the {@code settlementDate} property.
* @return the meta-property, not null
*/
public final MetaProperty<ZonedDateTimeBean> settlementDate() {
return _settlementDate;
}
/**
* The meta-property for the {@code isLong} property.
* @return the meta-property, not null
*/
public final MetaProperty<Boolean> isLong() {
return _isLong;
}
/**
* The meta-property for the {@code optionExerciseType} property.
* @return the meta-property, not null
*/
public final MetaProperty<OptionExerciseType> optionExerciseType() {
return _optionExerciseType;
}
/**
* The meta-property for the {@code isDeliveryInCallCurrency} property.
* @return the meta-property, not null
*/
public final MetaProperty<Boolean> isDeliveryInCallCurrency() {
return _isDeliveryInCallCurrency;
}
//-----------------------------------------------------------------------
@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
switch (propertyName.hashCode()) {
case -984864697: // putAmount
return ((NonDeliverableFXOptionSecurityBean) bean).getPutAmount();
case 1066661974: // callAmount
return ((NonDeliverableFXOptionSecurityBean) bean).getCallAmount();
case -1289159373: // expiry
return ((NonDeliverableFXOptionSecurityBean) bean).getExpiry();
case 516393024: // putCurrency
return ((NonDeliverableFXOptionSecurityBean) bean).getPutCurrency();
case 643534991: // callCurrency
return ((NonDeliverableFXOptionSecurityBean) bean).getCallCurrency();
case -295948169: // settlementDate
return ((NonDeliverableFXOptionSecurityBean) bean).getSettlementDate();
case -1180327226: // isLong
return ((NonDeliverableFXOptionSecurityBean) bean).getIsLong();
case -266326457: // optionExerciseType
return ((NonDeliverableFXOptionSecurityBean) bean).getOptionExerciseType();
case -426676942: // isDeliveryInCallCurrency
return ((NonDeliverableFXOptionSecurityBean) bean).getIsDeliveryInCallCurrency();
}
return super.propertyGet(bean, propertyName, quiet);
}
@Override
protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
switch (propertyName.hashCode()) {
case -984864697: // putAmount
((NonDeliverableFXOptionSecurityBean) bean).setPutAmount((Double) newValue);
return;
case 1066661974: // callAmount
((NonDeliverableFXOptionSecurityBean) bean).setCallAmount((Double) newValue);
return;
case -1289159373: // expiry
((NonDeliverableFXOptionSecurityBean) bean).setExpiry((ExpiryBean) newValue);
return;
case 516393024: // putCurrency
((NonDeliverableFXOptionSecurityBean) bean).setPutCurrency((CurrencyBean) newValue);
return;
case 643534991: // callCurrency
((NonDeliverableFXOptionSecurityBean) bean).setCallCurrency((CurrencyBean) newValue);
return;
case -295948169: // settlementDate
((NonDeliverableFXOptionSecurityBean) bean).setSettlementDate((ZonedDateTimeBean) newValue);
return;
case -1180327226: // isLong
((NonDeliverableFXOptionSecurityBean) bean).setIsLong((Boolean) newValue);
return;
case -266326457: // optionExerciseType
((NonDeliverableFXOptionSecurityBean) bean).setOptionExerciseType((OptionExerciseType) newValue);
return;
case -426676942: // isDeliveryInCallCurrency
((NonDeliverableFXOptionSecurityBean) bean).setIsDeliveryInCallCurrency((Boolean) newValue);
return;
}
super.propertySet(bean, propertyName, newValue, quiet);
}
}
///CLOVER:ON
//-------------------------- AUTOGENERATED END --------------------------
}