com.h3c.util.persistence.cassandra.entitymgr

## Class ColumnFamilyDefinition<I extends Serializable,K extends Serializable & Comparable<K>>

- java.lang.Object
- - com.h3c.util.persistence.cassandra.entitymgr.ColumnFamilyDefinition<I,K>

- Type Parameters:
    `I` - type of the row key
    `K` - type of the column key or name

      public class ColumnFamilyDefinition<I extends Serializable,K extends Serializable & Comparable<K>>
      extends Object

  Column family definition. Note: Astyanax also provides a ColumnFamilyDefinition which is not type-safe. This column family definition class has the same purpose, it is just a type safe alternative.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ColumnFamilyDefinition(com.netflix.astyanax.model.ColumnFamily<I,K> columnFamily, CassDataTypes keyValidator, CassDataTypes defaultValidator, CassDataTypes comparator, String comment)` Creates a column family definition.
    `ColumnFamilyDefinition(com.netflix.astyanax.model.ColumnFamily<I,K> columnFamily, CassDataTypes keyValidator, CassDataTypes defaultValidator, CassDataTypes comparator, String comment, Collection<ColumnName<K,?>> cfMeta)` Constructor for ColumnFamilyDefinition.
    `ColumnFamilyDefinition(com.netflix.astyanax.model.ColumnFamily<I,K> columnFamily, CassDataTypes keyValidator, CassDataTypes comparator, String comment)` Creates a column family definition that stores column values as bytes.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<ColumnName<K,?>>` | `getCfMeta()` Returns Column family Meta.
    `com.netflix.astyanax.model.ColumnFamily<I,K>` | `getColumnFamily()` Gets the column family.
    `String` | `getComment()` Gets the column family comment or description.
    `CassDataTypes` | `getComparator()` Gets the comparator or column name type.
    `CassDataTypes` | `getDefaultValidator()` Gets the default validator or column value type.
    `CassDataTypes` | `getKeyValidator()` Gets the key validator.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ColumnFamilyDefinition

          public ColumnFamilyDefinition(com.netflix.astyanax.model.ColumnFamily<I,K> columnFamily,
                                CassDataTypes keyValidator,
                                CassDataTypes comparator,
                                String comment)

      Creates a column family definition that stores column values as bytes.
      Parameters:
        `columnFamily` - column family.
        `keyValidator` - row key type.
        `comparator` - column name type. Within a row, columns are always stored in sorted order by their column name. The comparator specifies the data type for the column name, as well as the sort order in which columns are stored within a row. Unlike validators, the comparator may not be changed after the column family is defined, so this is an important consideration when defining a column family in Cassandra.
        `comment` - column family comment or description.

    - #### ColumnFamilyDefinition

          public ColumnFamilyDefinition(com.netflix.astyanax.model.ColumnFamily<I,K> columnFamily,
                                CassDataTypes keyValidator,
                                CassDataTypes defaultValidator,
                                CassDataTypes comparator,
                                String comment)

      Creates a column family definition.
      Parameters:
        `columnFamily` - column family
        `keyValidator` - row key type.
        `defaultValidator` - column value type. Note: If columns will have numeric values do not use UTF8 as the default validator because numeric values will mostly not be encoded/decoded to characters and vice versa. Otherwise "String didn't validate" error will be thrown.
        `comparator` - column name type. Within a row, columns are always stored in sorted order by their column name. The comparator specifies the data type for the column name, as well as the sort order in which columns are stored within a row. Unlike validators, the comparator may not be changed after the column family is defined, so this is an important consideration when defining a column family in Cassandra.
        `comment` - column family comment or description.

    - #### ColumnFamilyDefinition

          public ColumnFamilyDefinition(com.netflix.astyanax.model.ColumnFamily<I,K> columnFamily,
                                CassDataTypes keyValidator,
                                CassDataTypes defaultValidator,
                                CassDataTypes comparator,
                                String comment,
                                Collection<ColumnName<K,?>> cfMeta)

      Constructor for ColumnFamilyDefinition.
      Parameters:
        `columnFamily` - ColumnFamily
        `keyValidator` - CassDataTypes
        `defaultValidator` - CassDataTypes
        `comparator` - CassDataTypes
        `comment` - String
        `cfMeta` - Collection>

  - ### Method Detail

    - #### getColumnFamily

          public com.netflix.astyanax.model.ColumnFamily<I,K> getColumnFamily()

      Gets the column family.
      Returns:
        the column family

    - #### getKeyValidator

          public CassDataTypes getKeyValidator()

      Gets the key validator.
      Returns:
        the key validator

    - #### getDefaultValidator

          public CassDataTypes getDefaultValidator()

      Gets the default validator or column value type.
      Returns:
        the default validator

    - #### getComparator

          public CassDataTypes getComparator()

      Gets the comparator or column name type.
      Returns:
        the comparator

    - #### getComment

          public String getComment()

      Gets the column family comment or description.
      Returns:
        the column family comment or description

    - #### getCfMeta

          public Collection<ColumnName<K,?>> getCfMeta()

      Returns Column family Meta.
      Returns:
        Collection>

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014. All Rights Reserved.