com.opengamma.masterdb.security.hibernate.option.EquityBarrierOptionSecurityBean.java Source code

Java tutorial

Introduction

Here is the source code for com.opengamma.masterdb.security.hibernate.option.EquityBarrierOptionSecurityBean.java

Source

/**
 * Copyright (C) 2009 - 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.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.BarrierDirection;
import com.opengamma.financial.security.option.BarrierType;
import com.opengamma.financial.security.option.EquityBarrierOptionSecurity;
import com.opengamma.financial.security.option.MonitoringType;
import com.opengamma.financial.security.option.OptionType;
import com.opengamma.financial.security.option.SamplingFrequency;
import com.opengamma.masterdb.security.hibernate.CurrencyBean;
import com.opengamma.masterdb.security.hibernate.ExchangeBean;
import com.opengamma.masterdb.security.hibernate.ExpiryBean;
import com.opengamma.masterdb.security.hibernate.ExternalIdBean;
import com.opengamma.masterdb.security.hibernate.SecurityBean;

/**
 * A Hibernate bean representation of {@link EquityBarrierOptionSecurity}.
 */
@BeanDefinition
public class EquityBarrierOptionSecurityBean extends SecurityBean {
    @PropertyDefinition
    private OptionExerciseType _optionExerciseType;
    @PropertyDefinition
    private OptionType _optionType;
    @PropertyDefinition
    private double _strike;
    @PropertyDefinition
    private ExpiryBean _expiry;
    @PropertyDefinition
    private CurrencyBean _currency;
    @PropertyDefinition
    private ExchangeBean _exchange;
    @PropertyDefinition
    private Double _pointValue;
    @PropertyDefinition
    private ExternalIdBean _underlying;
    @PropertyDefinition
    private BarrierType _barrierType;
    @PropertyDefinition
    private BarrierDirection _barrierDirection;
    @PropertyDefinition
    private MonitoringType _monitoringType;
    @PropertyDefinition
    private SamplingFrequency _samplingFrequency;
    @PropertyDefinition
    private double _barrierLevel;

    public EquityBarrierOptionSecurityBean() {
        super();
    }

    @Override
    public boolean equals(final Object other) {
        if (!(other instanceof EquityBarrierOptionSecurityBean)) {
            return false;
        }
        final EquityBarrierOptionSecurityBean option = (EquityBarrierOptionSecurityBean) other;
        return new EqualsBuilder().append(getId(), option.getId()).append(getOptionType(), option.getOptionType())
                .append(getStrike(), option.getStrike()).append(getExpiry(), option.getExpiry())
                .append(getUnderlying(), option.getUnderlying()).append(getCurrency(), option.getCurrency())
                .append(getExchange(), option.getExchange()).append(getPointValue(), option.getPointValue())
                .append(getOptionExerciseType(), option.getOptionExerciseType()).isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(getOptionType()).append(getStrike()).append(getExpiry())
                .append(getUnderlying()).append(getCurrency()).append(getExchange()).append(getPointValue())
                .append(getOptionExerciseType()).toHashCode();
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

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

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

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

    @Override
    protected Object propertyGet(String propertyName, boolean quiet) {
        switch (propertyName.hashCode()) {
        case -266326457: // optionExerciseType
            return getOptionExerciseType();
        case 1373587791: // optionType
            return getOptionType();
        case -891985998: // strike
            return getStrike();
        case -1289159373: // expiry
            return getExpiry();
        case 575402001: // currency
            return getCurrency();
        case 1989774883: // exchange
            return getExchange();
        case 1257391553: // pointValue
            return getPointValue();
        case -1770633379: // underlying
            return getUnderlying();
        case 1029043089: // barrierType
            return getBarrierType();
        case 502579592: // barrierDirection
            return getBarrierDirection();
        case -1483652190: // monitoringType
            return getMonitoringType();
        case 1178782005: // samplingFrequency
            return getSamplingFrequency();
        case 1827586573: // barrierLevel
            return getBarrierLevel();
        }
        return super.propertyGet(propertyName, quiet);
    }

    @Override
    protected void propertySet(String propertyName, Object newValue, boolean quiet) {
        switch (propertyName.hashCode()) {
        case -266326457: // optionExerciseType
            setOptionExerciseType((OptionExerciseType) newValue);
            return;
        case 1373587791: // optionType
            setOptionType((OptionType) newValue);
            return;
        case -891985998: // strike
            setStrike((Double) newValue);
            return;
        case -1289159373: // expiry
            setExpiry((ExpiryBean) newValue);
            return;
        case 575402001: // currency
            setCurrency((CurrencyBean) newValue);
            return;
        case 1989774883: // exchange
            setExchange((ExchangeBean) newValue);
            return;
        case 1257391553: // pointValue
            setPointValue((Double) newValue);
            return;
        case -1770633379: // underlying
            setUnderlying((ExternalIdBean) newValue);
            return;
        case 1029043089: // barrierType
            setBarrierType((BarrierType) newValue);
            return;
        case 502579592: // barrierDirection
            setBarrierDirection((BarrierDirection) newValue);
            return;
        case -1483652190: // monitoringType
            setMonitoringType((MonitoringType) newValue);
            return;
        case 1178782005: // samplingFrequency
            setSamplingFrequency((SamplingFrequency) newValue);
            return;
        case 1827586573: // barrierLevel
            setBarrierLevel((Double) newValue);
            return;
        }
        super.propertySet(propertyName, newValue, quiet);
    }

    //-----------------------------------------------------------------------
    /**
     * 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 optionType.
     * @return the value of the property
     */
    public OptionType getOptionType() {
        return _optionType;
    }

    /**
     * Sets the optionType.
     * @param optionType  the new value of the property
     */
    public void setOptionType(OptionType optionType) {
        this._optionType = optionType;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the strike.
     * @return the value of the property
     */
    public double getStrike() {
        return _strike;
    }

    /**
     * Sets the strike.
     * @param strike  the new value of the property
     */
    public void setStrike(double strike) {
        this._strike = strike;
    }

    /**
     * Gets the the {@code strike} property.
     * @return the property, not null
     */
    public final Property<Double> strike() {
        return metaBean().strike().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 currency.
     * @return the value of the property
     */
    public CurrencyBean getCurrency() {
        return _currency;
    }

    /**
     * Sets the currency.
     * @param currency  the new value of the property
     */
    public void setCurrency(CurrencyBean currency) {
        this._currency = currency;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the exchange.
     * @return the value of the property
     */
    public ExchangeBean getExchange() {
        return _exchange;
    }

    /**
     * Sets the exchange.
     * @param exchange  the new value of the property
     */
    public void setExchange(ExchangeBean exchange) {
        this._exchange = exchange;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the pointValue.
     * @return the value of the property
     */
    public Double getPointValue() {
        return _pointValue;
    }

    /**
     * Sets the pointValue.
     * @param pointValue  the new value of the property
     */
    public void setPointValue(Double pointValue) {
        this._pointValue = pointValue;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the underlying.
     * @return the value of the property
     */
    public ExternalIdBean getUnderlying() {
        return _underlying;
    }

    /**
     * Sets the underlying.
     * @param underlying  the new value of the property
     */
    public void setUnderlying(ExternalIdBean underlying) {
        this._underlying = underlying;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the barrierType.
     * @return the value of the property
     */
    public BarrierType getBarrierType() {
        return _barrierType;
    }

    /**
     * Sets the barrierType.
     * @param barrierType  the new value of the property
     */
    public void setBarrierType(BarrierType barrierType) {
        this._barrierType = barrierType;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the barrierDirection.
     * @return the value of the property
     */
    public BarrierDirection getBarrierDirection() {
        return _barrierDirection;
    }

    /**
     * Sets the barrierDirection.
     * @param barrierDirection  the new value of the property
     */
    public void setBarrierDirection(BarrierDirection barrierDirection) {
        this._barrierDirection = barrierDirection;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the monitoringType.
     * @return the value of the property
     */
    public MonitoringType getMonitoringType() {
        return _monitoringType;
    }

    /**
     * Sets the monitoringType.
     * @param monitoringType  the new value of the property
     */
    public void setMonitoringType(MonitoringType monitoringType) {
        this._monitoringType = monitoringType;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the samplingFrequency.
     * @return the value of the property
     */
    public SamplingFrequency getSamplingFrequency() {
        return _samplingFrequency;
    }

    /**
     * Sets the samplingFrequency.
     * @param samplingFrequency  the new value of the property
     */
    public void setSamplingFrequency(SamplingFrequency samplingFrequency) {
        this._samplingFrequency = samplingFrequency;
    }

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

    //-----------------------------------------------------------------------
    /**
     * Gets the barrierLevel.
     * @return the value of the property
     */
    public double getBarrierLevel() {
        return _barrierLevel;
    }

    /**
     * Sets the barrierLevel.
     * @param barrierLevel  the new value of the property
     */
    public void setBarrierLevel(double barrierLevel) {
        this._barrierLevel = barrierLevel;
    }

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

    //-----------------------------------------------------------------------
    /**
     * The meta-bean for {@code EquityBarrierOptionSecurityBean}.
     */
    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 optionExerciseType} property.
         */
        private final MetaProperty<OptionExerciseType> _optionExerciseType = DirectMetaProperty.ofReadWrite(this,
                "optionExerciseType", EquityBarrierOptionSecurityBean.class, OptionExerciseType.class);
        /**
         * The meta-property for the {@code optionType} property.
         */
        private final MetaProperty<OptionType> _optionType = DirectMetaProperty.ofReadWrite(this, "optionType",
                EquityBarrierOptionSecurityBean.class, OptionType.class);
        /**
         * The meta-property for the {@code strike} property.
         */
        private final MetaProperty<Double> _strike = DirectMetaProperty.ofReadWrite(this, "strike",
                EquityBarrierOptionSecurityBean.class, Double.TYPE);
        /**
         * The meta-property for the {@code expiry} property.
         */
        private final MetaProperty<ExpiryBean> _expiry = DirectMetaProperty.ofReadWrite(this, "expiry",
                EquityBarrierOptionSecurityBean.class, ExpiryBean.class);
        /**
         * The meta-property for the {@code currency} property.
         */
        private final MetaProperty<CurrencyBean> _currency = DirectMetaProperty.ofReadWrite(this, "currency",
                EquityBarrierOptionSecurityBean.class, CurrencyBean.class);
        /**
         * The meta-property for the {@code exchange} property.
         */
        private final MetaProperty<ExchangeBean> _exchange = DirectMetaProperty.ofReadWrite(this, "exchange",
                EquityBarrierOptionSecurityBean.class, ExchangeBean.class);
        /**
         * The meta-property for the {@code pointValue} property.
         */
        private final MetaProperty<Double> _pointValue = DirectMetaProperty.ofReadWrite(this, "pointValue",
                EquityBarrierOptionSecurityBean.class, Double.class);
        /**
         * The meta-property for the {@code underlying} property.
         */
        private final MetaProperty<ExternalIdBean> _underlying = DirectMetaProperty.ofReadWrite(this, "underlying",
                EquityBarrierOptionSecurityBean.class, ExternalIdBean.class);
        /**
         * The meta-property for the {@code barrierType} property.
         */
        private final MetaProperty<BarrierType> _barrierType = DirectMetaProperty.ofReadWrite(this, "barrierType",
                EquityBarrierOptionSecurityBean.class, BarrierType.class);
        /**
         * The meta-property for the {@code barrierDirection} property.
         */
        private final MetaProperty<BarrierDirection> _barrierDirection = DirectMetaProperty.ofReadWrite(this,
                "barrierDirection", EquityBarrierOptionSecurityBean.class, BarrierDirection.class);
        /**
         * The meta-property for the {@code monitoringType} property.
         */
        private final MetaProperty<MonitoringType> _monitoringType = DirectMetaProperty.ofReadWrite(this,
                "monitoringType", EquityBarrierOptionSecurityBean.class, MonitoringType.class);
        /**
         * The meta-property for the {@code samplingFrequency} property.
         */
        private final MetaProperty<SamplingFrequency> _samplingFrequency = DirectMetaProperty.ofReadWrite(this,
                "samplingFrequency", EquityBarrierOptionSecurityBean.class, SamplingFrequency.class);
        /**
         * The meta-property for the {@code barrierLevel} property.
         */
        private final MetaProperty<Double> _barrierLevel = DirectMetaProperty.ofReadWrite(this, "barrierLevel",
                EquityBarrierOptionSecurityBean.class, Double.TYPE);
        /**
         * The meta-properties.
         */
        private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(this,
                (DirectMetaPropertyMap) super.metaPropertyMap(), "optionExerciseType", "optionType", "strike",
                "expiry", "currency", "exchange", "pointValue", "underlying", "barrierType", "barrierDirection",
                "monitoringType", "samplingFrequency", "barrierLevel");

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

        @Override
        protected MetaProperty<?> metaPropertyGet(String propertyName) {
            switch (propertyName.hashCode()) {
            case -266326457: // optionExerciseType
                return _optionExerciseType;
            case 1373587791: // optionType
                return _optionType;
            case -891985998: // strike
                return _strike;
            case -1289159373: // expiry
                return _expiry;
            case 575402001: // currency
                return _currency;
            case 1989774883: // exchange
                return _exchange;
            case 1257391553: // pointValue
                return _pointValue;
            case -1770633379: // underlying
                return _underlying;
            case 1029043089: // barrierType
                return _barrierType;
            case 502579592: // barrierDirection
                return _barrierDirection;
            case -1483652190: // monitoringType
                return _monitoringType;
            case 1178782005: // samplingFrequency
                return _samplingFrequency;
            case 1827586573: // barrierLevel
                return _barrierLevel;
            }
            return super.metaPropertyGet(propertyName);
        }

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

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

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

        //-----------------------------------------------------------------------
        /**
         * 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 optionType} property.
         * @return the meta-property, not null
         */
        public final MetaProperty<OptionType> optionType() {
            return _optionType;
        }

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

        /**
         * 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 currency} property.
         * @return the meta-property, not null
         */
        public final MetaProperty<CurrencyBean> currency() {
            return _currency;
        }

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

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

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

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

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

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

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

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

    }

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