public class FieldTypes extends Object
| Constructor and Description |
|---|
FieldTypes() |
| Modifier and Type | Method and Description |
|---|---|
static int |
determineLengthInBytes(byte[] bytes,
int offset,
co.cask.cdap.api.dataset.lib.Partitioning.FieldType type) |
static <T extends Comparable> |
fromBytes(byte[] bytes,
int offset,
int length,
co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
Deserialize a value of this field type, starting at given offset in the byte array, consuming
the given number of bytes.
|
static <T extends Comparable> |
parse(String str,
co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
Parse a string into a value of this field type.
|
static <T extends Comparable> |
toBytes(T value,
co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
Convert a value of this field type to a byte array.
|
static String |
toHiveType(co.cask.cdap.api.dataset.lib.Partitioning.FieldType type) |
static boolean |
validateType(Comparable value,
co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
Validate that a given value has the type that is required by this field type.
|
public static <T extends Comparable> T parse(String str, co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
Partitioning.FieldType.INT delegates this
to Integer.parseInt(java.lang.String, int).str - the string to parsepublic static <T extends Comparable> byte[] toBytes(T value, co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
T - the Java type represented by this field typevalue - the value to convertpublic static int determineLengthInBytes(byte[] bytes,
int offset,
co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
public static <T extends Comparable> T fromBytes(byte[] bytes, int offset, int length, co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
public static boolean validateType(Comparable value, co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
public static String toHiveType(co.cask.cdap.api.dataset.lib.Partitioning.FieldType type)
Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.