/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.masterdb.security.hibernate.index; import java.math.BigDecimal; import java.util.Map; import java.util.Set; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; 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.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 com.opengamma.masterdb.security.hibernate.ExternalIdBean; /** * A Hibernate bean representation of {@link BondIndexComponentBean}. */ @BeanDefinition public class BondIndexComponentBean extends DirectBean { @PropertyDefinition private Long _id; @PropertyDefinition private Long _position; @PropertyDefinition private BondIndexBean _bondIndex; @PropertyDefinition private Set<ExternalIdBean> _identifiers; @PropertyDefinition private BigDecimal _weight; @Override public boolean equals(final Object other) { if (!(other instanceof BondIndexComponentBean)) { return false; } BondIndexComponentBean index = (BondIndexComponentBean) other; return new EqualsBuilder() .append(getId(), index.getId()) .append(getPosition(), index.getPosition()) .append(getIdentifiers(), index.getIdentifiers()) .append(getBondIndex(), index.getBondIndex()) .append(getWeight(), index.getWeight()) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder() .append(getId()) .append(getPosition()) .append(getIdentifiers()) .append(getBondIndex()) .append(getWeight()) .toHashCode(); } //------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF /** * The meta-bean for {@code BondIndexComponentBean}. * @return the meta-bean, not null */ public static BondIndexComponentBean.Meta meta() { return BondIndexComponentBean.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(BondIndexComponentBean.Meta.INSTANCE); } @Override public BondIndexComponentBean.Meta metaBean() { return BondIndexComponentBean.Meta.INSTANCE; } //----------------------------------------------------------------------- /** * Gets the id. * @return the value of the property */ public Long getId() { return _id; } /** * Sets the id. * @param id the new value of the property */ public void setId(Long id) { this._id = id; } /** * Gets the the {@code id} property. * @return the property, not null */ public final Property<Long> id() { return metaBean().id().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the position. * @return the value of the property */ public Long getPosition() { return _position; } /** * Sets the position. * @param position the new value of the property */ public void setPosition(Long position) { this._position = position; } /** * Gets the the {@code position} property. * @return the property, not null */ public final Property<Long> position() { return metaBean().position().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the bondIndex. * @return the value of the property */ public BondIndexBean getBondIndex() { return _bondIndex; } /** * Sets the bondIndex. * @param bondIndex the new value of the property */ public void setBondIndex(BondIndexBean bondIndex) { this._bondIndex = bondIndex; } /** * Gets the the {@code bondIndex} property. * @return the property, not null */ public final Property<BondIndexBean> bondIndex() { return metaBean().bondIndex().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the identifiers. * @return the value of the property */ public Set<ExternalIdBean> getIdentifiers() { return _identifiers; } /** * Sets the identifiers. * @param identifiers the new value of the property */ public void setIdentifiers(Set<ExternalIdBean> identifiers) { this._identifiers = identifiers; } /** * Gets the the {@code identifiers} property. * @return the property, not null */ public final Property<Set<ExternalIdBean>> identifiers() { return metaBean().identifiers().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the weight. * @return the value of the property */ public BigDecimal getWeight() { return _weight; } /** * Sets the weight. * @param weight the new value of the property */ public void setWeight(BigDecimal weight) { this._weight = weight; } /** * Gets the the {@code weight} property. * @return the property, not null */ public final Property<BigDecimal> weight() { return metaBean().weight().createProperty(this); } //----------------------------------------------------------------------- @Override public BondIndexComponentBean clone() { return JodaBeanUtils.cloneAlways(this); } @Override public String toString() { StringBuilder buf = new StringBuilder(192); buf.append("BondIndexComponentBean{"); int len = buf.length(); toString(buf); if (buf.length() > len) { buf.setLength(buf.length() - 2); } buf.append('}'); return buf.toString(); } protected void toString(StringBuilder buf) { buf.append("id").append('=').append(JodaBeanUtils.toString(getId())).append(',').append(' '); buf.append("position").append('=').append(JodaBeanUtils.toString(getPosition())).append(',').append(' '); buf.append("bondIndex").append('=').append(JodaBeanUtils.toString(getBondIndex())).append(',').append(' '); buf.append("identifiers").append('=').append(JodaBeanUtils.toString(getIdentifiers())).append(',').append(' '); buf.append("weight").append('=').append(JodaBeanUtils.toString(getWeight())).append(',').append(' '); } //----------------------------------------------------------------------- /** * The meta-bean for {@code BondIndexComponentBean}. */ 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 id} property. */ private final MetaProperty<Long> _id = DirectMetaProperty.ofReadWrite( this, "id", BondIndexComponentBean.class, Long.class); /** * The meta-property for the {@code position} property. */ private final MetaProperty<Long> _position = DirectMetaProperty.ofReadWrite( this, "position", BondIndexComponentBean.class, Long.class); /** * The meta-property for the {@code bondIndex} property. */ private final MetaProperty<BondIndexBean> _bondIndex = DirectMetaProperty.ofReadWrite( this, "bondIndex", BondIndexComponentBean.class, BondIndexBean.class); /** * The meta-property for the {@code identifiers} property. */ @SuppressWarnings({"unchecked", "rawtypes" }) private final MetaProperty<Set<ExternalIdBean>> _identifiers = DirectMetaProperty.ofReadWrite( this, "identifiers", BondIndexComponentBean.class, (Class) Set.class); /** * The meta-property for the {@code weight} property. */ private final MetaProperty<BigDecimal> _weight = DirectMetaProperty.ofReadWrite( this, "weight", BondIndexComponentBean.class, BigDecimal.class); /** * The meta-properties. */ private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap( this, null, "id", "position", "bondIndex", "identifiers", "weight"); /** * Restricted constructor. */ protected Meta() { } @Override protected MetaProperty<?> metaPropertyGet(String propertyName) { switch (propertyName.hashCode()) { case 3355: // id return _id; case 747804969: // position return _position; case 916406223: // bondIndex return _bondIndex; case 1368189162: // identifiers return _identifiers; case -791592328: // weight return _weight; } return super.metaPropertyGet(propertyName); } @Override public BeanBuilder<? extends BondIndexComponentBean> builder() { return new DirectBeanBuilder<BondIndexComponentBean>(new BondIndexComponentBean()); } @Override public Class<? extends BondIndexComponentBean> beanType() { return BondIndexComponentBean.class; } @Override public Map<String, MetaProperty<?>> metaPropertyMap() { return _metaPropertyMap$; } //----------------------------------------------------------------------- /** * The meta-property for the {@code id} property. * @return the meta-property, not null */ public final MetaProperty<Long> id() { return _id; } /** * The meta-property for the {@code position} property. * @return the meta-property, not null */ public final MetaProperty<Long> position() { return _position; } /** * The meta-property for the {@code bondIndex} property. * @return the meta-property, not null */ public final MetaProperty<BondIndexBean> bondIndex() { return _bondIndex; } /** * The meta-property for the {@code identifiers} property. * @return the meta-property, not null */ public final MetaProperty<Set<ExternalIdBean>> identifiers() { return _identifiers; } /** * The meta-property for the {@code weight} property. * @return the meta-property, not null */ public final MetaProperty<BigDecimal> weight() { return _weight; } //----------------------------------------------------------------------- @Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 3355: // id return ((BondIndexComponentBean) bean).getId(); case 747804969: // position return ((BondIndexComponentBean) bean).getPosition(); case 916406223: // bondIndex return ((BondIndexComponentBean) bean).getBondIndex(); case 1368189162: // identifiers return ((BondIndexComponentBean) bean).getIdentifiers(); case -791592328: // weight return ((BondIndexComponentBean) bean).getWeight(); } return super.propertyGet(bean, propertyName, quiet); } @SuppressWarnings("unchecked") @Override protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) { switch (propertyName.hashCode()) { case 3355: // id ((BondIndexComponentBean) bean).setId((Long) newValue); return; case 747804969: // position ((BondIndexComponentBean) bean).setPosition((Long) newValue); return; case 916406223: // bondIndex ((BondIndexComponentBean) bean).setBondIndex((BondIndexBean) newValue); return; case 1368189162: // identifiers ((BondIndexComponentBean) bean).setIdentifiers((Set<ExternalIdBean>) newValue); return; case -791592328: // weight ((BondIndexComponentBean) bean).setWeight((BigDecimal) newValue); return; } super.propertySet(bean, propertyName, newValue, quiet); } } ///CLOVER:ON //-------------------------- AUTOGENERATED END -------------------------- }