com.basho.riak.client.raw.pbc
Class PBMapReduceResult

java.lang.Object
  extended by com.basho.riak.client.raw.pbc.PBMapReduceResult
All Implemented Interfaces:
MapReduceResult

public class PBMapReduceResult
extends Object
implements MapReduceResult

Concrete implementation of MapReduceResult that handles PB response stream

Author:
russell

Method Summary
<T> Collection<T>
getResult(Class<T> resultType)
          Mapped results to a simple java type, can be a Collection type (Map, List etc) or a Java Bean style class.
 String getResultRaw()
          The raw JSON string of the result
static PBMapReduceResult newResult(MapReduceResponseSource response)
          Factory method to create a response instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newResult

public static PBMapReduceResult newResult(MapReduceResponseSource response)
Factory method to create a response instance.

Parameters:
response -
Returns:
a ready to use PBMapReduceResult

getResultRaw

public String getResultRaw()
Description copied from interface: MapReduceResult
The raw JSON string of the result

Specified by:
getResultRaw in interface MapReduceResult
Returns:
a String of JSON, useful if you need to do your own de-serialization.

getResult

public <T> Collection<T> getResult(Class<T> resultType)
                        throws ConversionException
Description copied from interface: MapReduceResult
Mapped results to a simple java type, can be a Collection type (Map, List etc) or a Java Bean style class. NOTE: You can annotate a class with Jackson annotations, too, but that is an implementation detail that may change. Expect a set of annotations that are API specific soon.

Specified by:
getResult in interface MapReduceResult
Parameters:
resultType - A Java type to map the result too.
Returns:
a Collection of T.
Throws:
ConversionException


Copyright © 2012. All Rights Reserved.