me.prettyprint.cassandra.model
Class HCounterColumnImpl<N>

java.lang.Object
  extended by me.prettyprint.cassandra.model.HCounterColumnImpl<N>
Type Parameters:
N - The type of the column name
All Implemented Interfaces:
HCounterColumn<N>

public final class HCounterColumnImpl<N>
extends Object
implements HCounterColumn<N>

Hector Counter Column definition.

Author:
patricioe (patricioe@gmail.com)

Constructor Summary
HCounterColumnImpl(org.apache.cassandra.thrift.CounterColumn thriftCounterColumn, Serializer<N> nameSerializer)
           
HCounterColumnImpl(N name, Long value)
           
HCounterColumnImpl(N name, Long value, Serializer<N> nameSerializer)
           
HCounterColumnImpl(Serializer<N> nameSerializer)
           
 
Method Summary
 HCounterColumn<N> apply(org.apache.cassandra.thrift.CounterColumn c)
           
 HCounterColumn<N> apply(Long value, int ttl)
           
 HCounterColumn<N> clear()
          Clear value, timestamp and ttl (the latter two set to '0') leaving only the column name
 boolean equals(Object obj)
           
 HCounterColumn<N> fromThrift(org.apache.cassandra.thrift.CounterColumn c)
           
 N getName()
           
 ByteBuffer getNameBytes()
          (Advanced) Returns the underlying ByteBuffer for the name via ByteBuffer.duplicate().
 Serializer<N> getNameSerializer()
           
 int getTtl()
           
 Long getValue()
           
 int hashCode()
           
 HCounterColumn<N> setName(N name)
           
 HCounterColumn<N> setTtl(int ttl)
          Set the time-to-live value for this column in seconds.
 HCounterColumn<N> setValue(Long value)
           
 String toString()
           
 org.apache.cassandra.thrift.CounterColumn toThrift()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HCounterColumnImpl

public HCounterColumnImpl(N name,
                          Long value,
                          Serializer<N> nameSerializer)

HCounterColumnImpl

public HCounterColumnImpl(org.apache.cassandra.thrift.CounterColumn thriftCounterColumn,
                          Serializer<N> nameSerializer)

HCounterColumnImpl

public HCounterColumnImpl(Serializer<N> nameSerializer)

HCounterColumnImpl

public HCounterColumnImpl(N name,
                          Long value)
Method Detail

setName

public HCounterColumn<N> setName(N name)
Specified by:
setName in interface HCounterColumn<N>

setValue

public HCounterColumn<N> setValue(Long value)
Specified by:
setValue in interface HCounterColumn<N>

setTtl

public HCounterColumn<N> setTtl(int ttl)
Set the time-to-live value for this column in seconds. The server will mark this column as deleted once the number of seconds has elapsed.

Specified by:
setTtl in interface HCounterColumn<N>

getTtl

public int getTtl()
Specified by:
getTtl in interface HCounterColumn<N>

getName

public N getName()
Specified by:
getName in interface HCounterColumn<N>

getValue

public Long getValue()
Specified by:
getValue in interface HCounterColumn<N>

toThrift

public org.apache.cassandra.thrift.CounterColumn toThrift()

fromThrift

public HCounterColumn<N> fromThrift(org.apache.cassandra.thrift.CounterColumn c)

getNameSerializer

public Serializer<N> getNameSerializer()
Specified by:
getNameSerializer in interface HCounterColumn<N>

getNameBytes

public ByteBuffer getNameBytes()
Description copied from interface: HCounterColumn
(Advanced) Returns the underlying ByteBuffer for the name via ByteBuffer.duplicate().

Specified by:
getNameBytes in interface HCounterColumn<N>

clear

public HCounterColumn<N> clear()
Clear value, timestamp and ttl (the latter two set to '0') leaving only the column name

Specified by:
clear in interface HCounterColumn<N>

apply

public HCounterColumn<N> apply(Long value,
                               int ttl)
Specified by:
apply in interface HCounterColumn<N>

apply

public HCounterColumn<N> apply(org.apache.cassandra.thrift.CounterColumn c)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.