public class CastUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
mLog |
Constructor and Description |
---|
CastUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
convertToType(LoadCaster caster,
byte[] bytes,
ResourceSchema.ResourceFieldSchema fieldSchema,
byte dataType) |
static java.lang.Boolean |
stringToBoolean(java.lang.String str) |
static java.lang.Double |
stringToDouble(java.lang.String str) |
static java.lang.Float |
stringToFloat(java.lang.String str) |
static java.lang.Integer |
stringToInteger(java.lang.String str) |
static java.lang.Long |
stringToLong(java.lang.String str) |
public static java.lang.Object convertToType(LoadCaster caster, byte[] bytes, ResourceSchema.ResourceFieldSchema fieldSchema, byte dataType) throws java.io.IOException
caster
- LoadCaster to be used to convert the bytes into a field.bytes
- fieldSchema
- schema of Bag or Tuple; pass in null if a simple type.dataType
- type from DataTypejava.io.IOException
public static java.lang.Double stringToDouble(java.lang.String str)
public static java.lang.Float stringToFloat(java.lang.String str)
public static java.lang.Integer stringToInteger(java.lang.String str)
public static java.lang.Long stringToLong(java.lang.String str)
public static java.lang.Boolean stringToBoolean(java.lang.String str)
Copyright © 2007-2017 The Apache Software Foundation