<commit_before>/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.security.cds;

import java.util.List;
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.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.google.common.collect.Lists;
import com.opengamma.financial.security.FinancialSecurity;
import com.opengamma.financial.security.FinancialSecurityVisitor;
import com.opengamma.util.money.Currency;
import com.opengamma.util.time.Tenor;

/**
 * A security for Credit Default Swap Indices.
 */
@BeanDefinition
public class CreditDefaultSwapIndexSecurity extends FinancialSecurity {
  
  /** Serialization version. */
  private static final long serialVersionUID = 1L;
  /**
   * The security type.
   */
  public static final String SECURITY_TYPE = "CDS_INDEX";
  /**
   * The version number.
   */
  @PropertyDefinition(validate = "notNull")
  private String _version;
  /**
   * The series number.
   */
  @PropertyDefinition(validate = "notNull")
  private String _series;
  /**
   * The family
   */
  @PropertyDefinition(validate = "notNull")
  private String _family;
  /**
   * The currency.
   */
  @PropertyDefinition(validate = "notNull")
  private Currency _currency;
  /**
   * The terms.
   */
  @PropertyDefinition(validate = "notNull")
  private final List<Tenor> _terms = Lists.newArrayList();
  /**
   * The index components.
   */
  @PropertyDefinition(validate = "notNull")
  private final List<CreditDefaultSwapIndexComponent> _components = Lists.newArrayList();
  
  
  /**
   * Creates an instance
   */
  CreditDefaultSwapIndexSecurity() { //For builder
    super(SECURITY_TYPE);
  }
  
  @Override
  public <T> T accept(FinancialSecurityVisitor<T> visitor) {
    return visitor.visitCreditDefaultSwapIndexSecurity(this);
  }
  
  //------------------------- AUTOGENERATED START -------------------------
  ///CLOVER:OFF
  /**
   * The meta-bean for {@code CreditDefaultSwapIndexSecurity}.<commit_msg>Add public constructor<commit_after>/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.security.cds;

import java.util.List;
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.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.google.common.collect.Lists;
import com.opengamma.financial.security.FinancialSecurity;
import com.opengamma.financial.security.FinancialSecurityVisitor;
import com.opengamma.util.money.Currency;
import com.opengamma.util.time.Tenor;

/**
 * A security for Credit Default Swap Indices.
 */
@BeanDefinition
public class CreditDefaultSwapIndexSecurity extends FinancialSecurity {
  
  /** Serialization version. */
  private static final long serialVersionUID = 1L;
  /**
   * The security type.
   */
  public static final String SECURITY_TYPE = "CDS_INDEX";
  /**
   * The version number.
   */
  @PropertyDefinition(validate = "notNull")
  private String _version;
  /**
   * The series number.
   */
  @PropertyDefinition(validate = "notNull")
  private String _series;
  /**
   * The family
   */
  @PropertyDefinition(validate = "notNull")
  private String _family;
  /**
   * The currency.
   */
  @PropertyDefinition(validate = "notNull")
  private Currency _currency;
  /**
   * The terms.
   */
  @PropertyDefinition(validate = "notNull")
  private final List<Tenor> _terms = Lists.newArrayList();
  /**
   * The index components.
   */
  @PropertyDefinition(validate = "notNull")
  private final List<CreditDefaultSwapIndexComponent> _components = Lists.newArrayList();
  
  
  /**
   * Creates an instance
   */
  CreditDefaultSwapIndexSecurity() { //For builder
    super(SECURITY_TYPE);
  }
  
  /**
   * Creates an instance.
   * 
   * @param version  the version, not null
   * @param series  the series, not null
   * @param family  the family, not null
   * @param currency  the currency, not null
   */
  public CreditDefaultSwapIndexSecurity(String version, String series, String family, Currency currency) {
    super(SECURITY_TYPE);
    setVersion(version);
    setSeries(series);
    setFamily(family);
    setCurrency(currency);
  }
  
  @Override
  public <T> T accept(FinancialSecurityVisitor<T> visitor) {
    return visitor.visitCreditDefaultSwapIndexSecurity(this);
  }
  
  //------------------------- AUTOGENERATED START -------------------------
  ///CLOVER:OFF
  /**
   * The meta-bean for {@code CreditDefaultSwapIndexSecurity}.
{'fraction_non_alphanumeric': 0.12767598842815814, 'fraction_numerical': 0.0019286403085824494, 'mean_word_length': 3.581272084805654, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3026907', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1540, 'n_words': 352}