com.netflix.astyanax.model
Interface ColumnList<C>

Type Parameters:
C - Data type for column names
All Superinterfaces:
Iterable<Column<C>>
All Known Implementing Classes:
AbstractColumnList, EmptyColumnList, ThriftColumnListImpl, ThriftColumnOrSuperColumnListImpl, ThriftCounterColumnListImpl

public interface ColumnList<C>
extends Iterable<Column<C>>

Interface to a list of columns.

Author:
elandau

Method Summary
 Boolean getBooleanValue(C columnName, Boolean defaultValue)
          Get value as a boolean
 byte[] getByteArrayValue(C columnName, byte[] defaultValue)
          Get the raw byte[] value
 ByteBuffer getByteBufferValue(C columnName, ByteBuffer defaultValue)
          Get the raw ByteBuffer value
 Column<C> getColumnByIndex(int idx)
          Queries column by index
 Column<C> getColumnByName(C columnName)
          Queries column by name
 Date getDateValue(C columnName, Date defaultValue)
          Get the value as a date object
 Double getDoubleValue(C columnName, Double defaultValue)
          Return value as a double
 Integer getIntegerValue(C columnName, Integer defaultValue)
          Return value as an integer
 Long getLongValue(C columnName, Long defaultValue)
          Return value as a long.
 String getStringValue(C columnName, String defaultValue)
          Return value as a string
<C2> Column<C2>
getSuperColumn(C columnName, Serializer<C2> colSer)
          Deprecated. Super columns should be replaced with composite columns
<C2> Column<C2>
getSuperColumn(int idx, Serializer<C2> colSer)
          Deprecated. Super columns should be replaced with composite columns
 UUID getUUIDValue(C columnName, UUID defaultValue)
          Get the value as a UUID
 boolean isEmpty()
          Indicates if the list of columns is empty
 boolean isSuperColumn()
          Deprecated. Super columns should be replaced with composite columns
 int size()
          returns the number of columns in the row
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getColumnByName

Column<C> getColumnByName(C columnName)
Queries column by name

Parameters:
columnName -
Returns:
an instance of a column or null if not found
Throws:
Exception

getStringValue

String getStringValue(C columnName,
                      String defaultValue)
Return value as a string

Returns:

getIntegerValue

Integer getIntegerValue(C columnName,
                        Integer defaultValue)
Return value as an integer

Returns:

getDoubleValue

Double getDoubleValue(C columnName,
                      Double defaultValue)
Return value as a double

Returns:

getLongValue

Long getLongValue(C columnName,
                  Long defaultValue)
Return value as a long. Use this to get the value of a counter column

Returns:

getByteArrayValue

byte[] getByteArrayValue(C columnName,
                         byte[] defaultValue)
Get the raw byte[] value

Returns:

getBooleanValue

Boolean getBooleanValue(C columnName,
                        Boolean defaultValue)
Get value as a boolean

Returns:

getByteBufferValue

ByteBuffer getByteBufferValue(C columnName,
                              ByteBuffer defaultValue)
Get the raw ByteBuffer value

Returns:

getDateValue

Date getDateValue(C columnName,
                  Date defaultValue)
Get the value as a date object

Returns:

getUUIDValue

UUID getUUIDValue(C columnName,
                  UUID defaultValue)
Get the value as a UUID

Returns:

getColumnByIndex

Column<C> getColumnByIndex(int idx)
Queries column by index

Parameters:
idx -
Returns:
Throws:
NetflixCassandraException

getSuperColumn

<C2> Column<C2> getSuperColumn(C columnName,
                               Serializer<C2> colSer)
Deprecated. Super columns should be replaced with composite columns

Return the super column with the specified name

Type Parameters:
C2 -
Parameters:
columnName -
colSer -
Returns:
Throws:
NetflixCassandraException

getSuperColumn

<C2> Column<C2> getSuperColumn(int idx,
                               Serializer<C2> colSer)
Deprecated. Super columns should be replaced with composite columns

Get super column by index

Parameters:
idx -
Returns:
Throws:
NetflixCassandraException

isEmpty

boolean isEmpty()
Indicates if the list of columns is empty

Returns:

size

int size()
returns the number of columns in the row

Returns:

isSuperColumn

boolean isSuperColumn()
Deprecated. Super columns should be replaced with composite columns

Returns true if the columns are super columns with subcolumns. If true then use getSuperColumn to call children. Otherwise call getColumnByIndex and getColumnByName to get the standard columns in the list.

Returns:


Copyright © 2012. All Rights Reserved.