This project has retired. For details please refer to its Attic page.
PTypes (Apache Crunch 0.4.0-incubating API)

org.apache.crunch.types
Class PTypes

java.lang.Object
  extended by org.apache.crunch.types.PTypes

public class PTypes
extends Object

Utility functions for creating common types of derived PTypes, e.g., for JSON data, protocol buffers, and Thrift records.


Nested Class Summary
static class PTypes.EnumInputMapper<T extends Enum>
           
static class PTypes.EnumOutputMapper<T extends Enum>
           
static class PTypes.JacksonInputMapFn<T>
           
static class PTypes.JacksonOutputMapFn<T>
           
static class PTypes.ProtoInputMapFn<T extends com.google.protobuf.Message>
           
static class PTypes.ProtoOutputMapFn<T extends com.google.protobuf.Message>
           
static class PTypes.ThriftInputMapFn<T extends org.apache.thrift.TBase>
           
static class PTypes.ThriftOutputMapFn<T extends org.apache.thrift.TBase>
           
 
Field Summary
static MapFn<BigInteger,ByteBuffer> BIGINT_TO_BYTE
           
static MapFn<ByteBuffer,BigInteger> BYTE_TO_BIGINT
           
 
Constructor Summary
PTypes()
           
 
Method Summary
static PType<BigInteger> bigInt(PTypeFamily typeFamily)
           
static
<T extends Enum>
PType<T>
enums(Class<T> type, PTypeFamily typeFamily)
           
static
<T> PType<T>
jsonString(Class<T> clazz, PTypeFamily typeFamily)
           
static
<T extends com.google.protobuf.Message>
PType<T>
protos(Class<T> clazz, PTypeFamily typeFamily)
           
static
<T extends org.apache.thrift.TBase>
PType<T>
thrifts(Class<T> clazz, PTypeFamily typeFamily)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_TO_BIGINT

public static MapFn<ByteBuffer,BigInteger> BYTE_TO_BIGINT

BIGINT_TO_BYTE

public static MapFn<BigInteger,ByteBuffer> BIGINT_TO_BYTE
Constructor Detail

PTypes

public PTypes()
Method Detail

bigInt

public static PType<BigInteger> bigInt(PTypeFamily typeFamily)

jsonString

public static <T> PType<T> jsonString(Class<T> clazz,
                                      PTypeFamily typeFamily)

protos

public static <T extends com.google.protobuf.Message> PType<T> protos(Class<T> clazz,
                                                                      PTypeFamily typeFamily)

thrifts

public static <T extends org.apache.thrift.TBase> PType<T> thrifts(Class<T> clazz,
                                                                   PTypeFamily typeFamily)

enums

public static final <T extends Enum> PType<T> enums(Class<T> type,
                                                    PTypeFamily typeFamily)


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