/** * 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.util.Map; 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; import com.opengamma.masterdb.security.hibernate.TenorBean; /** * A Hibernate bean representation of {@link IndexFamilyEntryBean}. */ @BeanDefinition public class IndexFamilyEntryBean extends DirectBean { @PropertyDefinition private TenorBean _tenor; @PropertyDefinition private ExternalIdBean _identifier; @Override public boolean equals(final Object other) { if (!(other instanceof IndexFamilyEntryBean)) { return false; } IndexFamilyEntryBean index = (IndexFamilyEntryBean) other; return new EqualsBuilder() .append(getTenor(), index.getTenor()) .append(getIdentifier(), index.getIdentifier()) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder() .append(getTenor()) .append(getIdentifier()) .toHashCode(); } //------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF /** * The meta-bean for {@code IndexFamilyEntryBean}. * @return the meta-bean, not null */ public static IndexFamilyEntryBean.Meta meta() { return IndexFamilyEntryBean.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(IndexFamilyEntryBean.Meta.INSTANCE); } @Override public IndexFamilyEntryBean.Meta metaBean() { return IndexFamilyEntryBean.Meta.INSTANCE; } //----------------------------------------------------------------------- /** * Gets the tenor. * @return the value of the property */ public TenorBean getTenor() { return _tenor; } /** * Sets the tenor. * @param tenor the new value of the property */ public void setTenor(TenorBean tenor) { this._tenor = tenor; } /** * Gets the the {@code tenor} property. * @return the property, not null */ public final Property<TenorBean> tenor() { return metaBean().tenor().createProperty(this); } //----------------------------------------------------------------------- /** * Gets the identifier. * @return the value of the property */ public ExternalIdBean getIdentifier() { return _identifier; } /** * Sets the identifier. * @param identifier the new value of the property */ public void setIdentifier(ExternalIdBean identifier) { this._identifier = identifier; } /** * Gets the the {@code identifier} property. * @return the property, not null */ public final Property<ExternalIdBean> identifier() { return metaBean().identifier().createProperty(this); } //----------------------------------------------------------------------- @Override public IndexFamilyEntryBean clone() { return JodaBeanUtils.cloneAlways(this); } @Override public String toString() { StringBuilder buf = new StringBuilder(96); buf.append("IndexFamilyEntryBean{"); 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("tenor").append('=').append(JodaBeanUtils.toString(getTenor())).append(',').append(' '); buf.append("identifier").append('=').append(JodaBeanUtils.toString(getIdentifier())).append(',').append(' '); } //----------------------------------------------------------------------- /** * The meta-bean for {@code IndexFamilyEntryBean}. */ 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 tenor} property. */ private final MetaProperty<TenorBean> _tenor = DirectMetaProperty.ofReadWrite( this, "tenor", IndexFamilyEntryBean.class, TenorBean.class); /** * The meta-property for the {@code identifier} property. */ private final MetaProperty<ExternalIdBean> _identifier = DirectMetaProperty.ofReadWrite( this, "identifier", IndexFamilyEntryBean.class, ExternalIdBean.class); /** * The meta-properties. */ private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap( this, null, "tenor", "identifier"); /** * Restricted constructor. */ protected Meta() { } @Override protected MetaProperty<?> metaPropertyGet(String propertyName) { switch (propertyName.hashCode()) { case 110246592: // tenor return _tenor; case -1618432855: // identifier return _identifier; } return super.metaPropertyGet(propertyName); } @Override public BeanBuilder<? extends IndexFamilyEntryBean> builder() { return new DirectBeanBuilder<IndexFamilyEntryBean>(new IndexFamilyEntryBean()); } @Override public Class<? extends IndexFamilyEntryBean> beanType() { return IndexFamilyEntryBean.class; } @Override public Map<String, MetaProperty<?>> metaPropertyMap() { return _metaPropertyMap$; } //----------------------------------------------------------------------- /** * The meta-property for the {@code tenor} property. * @return the meta-property, not null */ public final MetaProperty<TenorBean> tenor() { return _tenor; } /** * The meta-property for the {@code identifier} property. * @return the meta-property, not null */ public final MetaProperty<ExternalIdBean> identifier() { return _identifier; } //----------------------------------------------------------------------- @Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 110246592: // tenor return ((IndexFamilyEntryBean) bean).getTenor(); case -1618432855: // identifier return ((IndexFamilyEntryBean) bean).getIdentifier(); } return super.propertyGet(bean, propertyName, quiet); } @Override protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) { switch (propertyName.hashCode()) { case 110246592: // tenor ((IndexFamilyEntryBean) bean).setTenor((TenorBean) newValue); return; case -1618432855: // identifier ((IndexFamilyEntryBean) bean).setIdentifier((ExternalIdBean) newValue); return; } super.propertySet(bean, propertyName, newValue, quiet); } } ///CLOVER:ON //-------------------------- AUTOGENERATED END -------------------------- }