/** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.financial.security.swap; import java.util.Map; import org.joda.beans.BeanBuilder; import org.joda.beans.BeanDefinition; import org.joda.beans.JodaBeanUtils; import org.joda.beans.MetaProperty; import org.joda.beans.impl.direct.DirectMetaPropertyMap; import com.opengamma.financial.convention.businessday.BusinessDayConvention; import com.opengamma.financial.convention.daycount.DayCount; import com.opengamma.financial.convention.frequency.Frequency; import com.opengamma.id.ExternalId; /** * Abstract base class for an interest rate based leg in a swap. */ @BeanDefinition public abstract class InterestRateLeg extends SwapLeg { /** Serialization version. */ private static final long serialVersionUID = 1L; /** * Creates an instance. */ protected InterestRateLeg() { } /** * Creates an instance. * * @param dayCount the day count, not null * @param frequency the frequency, not null * @param regionIdentifier the region, not null * @param businessDayConvention the business day convention, not null * @param notional the notional, not null */ protected InterestRateLeg(DayCount dayCount, Frequency frequency, ExternalId regionIdentifier, BusinessDayConvention businessDayConvention, Notional notional) { setDayCount(dayCount); setFrequency(frequency); setRegionId(regionIdentifier); setBusinessDayConvention(businessDayConvention); setNotional(notional); } //------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF /** * The meta-bean for {@code InterestRateLeg}. * @return the meta-bean, not null */ public static InterestRateLeg.Meta meta() { return InterestRateLeg.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(InterestRateLeg.Meta.INSTANCE); } @Override public InterestRateLeg.Meta metaBean() { return InterestRateLeg.Meta.INSTANCE; } //----------------------------------------------------------------------- @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj != null && obj.getClass() == this.getClass()) { return super.equals(obj); } return false; } @Override public int hashCode() { int hash = 7; return hash ^ super.hashCode(); } @Override public String toString() { StringBuilder buf = new StringBuilder(32); buf.append("InterestRateLeg{"); 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); } //----------------------------------------------------------------------- /** * The meta-bean for {@code InterestRateLeg}. */ public static class Meta extends SwapLeg.Meta { /** * The singleton instance of the meta-bean. */ static final Meta INSTANCE = new Meta(); /** * The meta-properties. */ private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap( this, (DirectMetaPropertyMap) super.metaPropertyMap()); /** * Restricted constructor. */ protected Meta() { } @Override public BeanBuilder<? extends InterestRateLeg> builder() { throw new UnsupportedOperationException("InterestRateLeg is an abstract class"); } @Override public Class<? extends InterestRateLeg> beanType() { return InterestRateLeg.class; } @Override public Map<String, MetaProperty<?>> metaPropertyMap() { return _metaPropertyMap$; } //----------------------------------------------------------------------- } ///CLOVER:ON //-------------------------- AUTOGENERATED END -------------------------- }