KeySpaceDefinition.java :  » Cassandra » jassandra » org » softao » jassandra » Java Open Source

Java Open Source » Cassandra » jassandra 
jassandra » org » softao » jassandra » KeySpaceDefinition.java
package org.softao.jassandra;

import java.util.List;

import com.google.common.collect.Lists;

/**
 * The definition of a key space.
 */
public class KeySpaceDefinition {
  private String mName;
  private String mStrategyClass;
  private int mReplicationFactor;
  private final List<ColumnFamilyDefinition> mColumnFamilyDefinitions;

  /**
   * 
   */
  public KeySpaceDefinition() {
    mColumnFamilyDefinitions = Lists.newArrayList();
  }

  /**
   * @param definition
   *            the column family to be added
   */
  public void addColumnFamily(ColumnFamilyDefinition definition) {
    mColumnFamilyDefinitions.add(definition);
  }

  /**
   * @param definition
   *            the column family to be removed
   */
  public void removeColumnFamily(ColumnFamilyDefinition definition) {
    mColumnFamilyDefinitions.remove(definition);
  }

  /**
   * @return list of definitions.
   */
  public List<ColumnFamilyDefinition> getColumnFamilyDefinitions() {
    return Lists.newArrayList(mColumnFamilyDefinitions);
  }

  /**
   * @param name
   *            the name to set
   */
  public void setName(String name) {
    mName = name;
  }

  /**
   * @return the name
   */
  public String getName() {
    return mName;
  }

  /**
   * @param strategyClass
   *            the strategyClass to set
   */
  public void setStrategyClass(String strategyClass) {
    mStrategyClass = strategyClass;
  }

  /**
   * @return the strategyClass
   */
  public String getStrategyClass() {
    return mStrategyClass;
  }

  /**
   * @param replicationFactor
   *            the replicationFactor to set
   */
  public void setReplicationFactor(int replicationFactor) {
    mReplicationFactor = replicationFactor;
  }

  /**
   * @return the replicationFactor
   */
  public int getReplicationFactor() {
    return mReplicationFactor;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.