org.apache.hadoop.hbase.rest.model
Class RowModel

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.model.RowModel
All Implemented Interfaces:
Serializable, ProtobufMessageHandler

public class RowModel
extends Object
implements ProtobufMessageHandler, Serializable

Representation of a row. A row is a related set of cells, grouped by common row key. RowModels do not appear in results by themselves. They are always encapsulated within CellSetModels.

 <complexType name="Row">
   <sequence>
     <element name="key" type="base64Binary"></element>
     <element name="cell" type="tns:Cell" 
       maxOccurs="unbounded" minOccurs="1"></element>
   </sequence>
 </complexType>
 

See Also:
Serialized Form

Constructor Summary
RowModel()
          Default constructor
RowModel(byte[] key)
          Constructor
RowModel(byte[] key, List<CellModel> cells)
          Constructor
RowModel(String key)
          Constructor
RowModel(String key, List<CellModel> cells)
          Constructor
 
Method Summary
 void addCell(CellModel cell)
          Adds a cell to the list of cells for this row
 byte[] createProtobufOutput()
           
 List<CellModel> getCells()
           
 byte[] getKey()
           
 ProtobufMessageHandler getObjectFromMessage(byte[] message)
          Initialize the model from a protobuf representation.
 void setKey(byte[] key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowModel

public RowModel()
Default constructor


RowModel

public RowModel(String key)
Constructor

Parameters:
key - the row key

RowModel

public RowModel(byte[] key)
Constructor

Parameters:
key - the row key

RowModel

public RowModel(String key,
                List<CellModel> cells)
Constructor

Parameters:
key - the row key
cells - the cells

RowModel

public RowModel(byte[] key,
                List<CellModel> cells)
Constructor

Parameters:
key - the row key
cells - the cells
Method Detail

addCell

public void addCell(CellModel cell)
Adds a cell to the list of cells for this row

Parameters:
cell - the cell

getKey

public byte[] getKey()
Returns:
the row key

setKey

public void setKey(byte[] key)
Parameters:
key - the row key

getCells

public List<CellModel> getCells()
Returns:
the cells

createProtobufOutput

public byte[] createProtobufOutput()
Specified by:
createProtobufOutput in interface ProtobufMessageHandler
Returns:
the protobuf represention of the model

getObjectFromMessage

public ProtobufMessageHandler getObjectFromMessage(byte[] message)
                                            throws IOException
Description copied from interface: ProtobufMessageHandler
Initialize the model from a protobuf representation.

Specified by:
getObjectFromMessage in interface ProtobufMessageHandler
Parameters:
message - the raw bytes of the protobuf message
Returns:
reference to self for convenience
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.