public class TypeDescriptors
extends java.lang.Object
TypeDescriptor
equivalents. Also, has methods
for classes that wrap Java primitives like KV
,
Set
, List
, and Iterable
.Constructor and Description |
---|
TypeDescriptors() |
Modifier and Type | Method and Description |
---|---|
static TypeDescriptor<java.math.BigDecimal> |
bigdecimals()
The
TypeDescriptor for BigDecimal. |
static TypeDescriptor<java.math.BigInteger> |
bigintegers()
The
TypeDescriptor for BigInteger. |
static TypeDescriptor<java.lang.Boolean> |
booleans()
The
TypeDescriptor for Boolean. |
static TypeDescriptor<java.lang.Byte> |
bytes()
The
TypeDescriptor for Byte. |
static TypeDescriptor<java.lang.Character> |
characters()
The
TypeDescriptor for Character. |
static TypeDescriptor<java.lang.Double> |
doubles()
The
TypeDescriptor for Double. |
static TypeDescriptor<java.lang.Float> |
floats()
The
TypeDescriptor for Float. |
static TypeDescriptor<java.lang.Integer> |
integers()
The
TypeDescriptor for Integer. |
static <T> TypeDescriptor<java.lang.Iterable<T>> |
iterables(TypeDescriptor<T> iterable)
The
TypeDescriptor for Iterable . |
static <K,V> TypeDescriptor<KV<K,V>> |
kvs(TypeDescriptor<K> key,
TypeDescriptor<V> value)
The
TypeDescriptor for KV . |
static <T> TypeDescriptor<java.util.List<T>> |
lists(TypeDescriptor<T> element)
The
TypeDescriptor for List . |
static TypeDescriptor<java.lang.Long> |
longs()
The
TypeDescriptor for Long. |
static TypeDescriptor<java.lang.Void> |
nulls()
The
TypeDescriptor for nulls/Void. |
static <T> TypeDescriptor<java.util.Set<T>> |
sets(TypeDescriptor<T> element)
The
TypeDescriptor for Set . |
static TypeDescriptor<java.lang.Short> |
shorts()
The
TypeDescriptor for Short. |
static TypeDescriptor<java.lang.String> |
strings()
The
TypeDescriptor for String. |
public static TypeDescriptor<java.lang.Boolean> booleans()
TypeDescriptor
for Boolean.
This is the equivalent of:
new TypeDescriptor<Boolean>() {};
TypeDescriptor
for Booleanpublic static TypeDescriptor<java.lang.Double> doubles()
TypeDescriptor
for Double.
This is the equivalent of:
new TypeDescriptor<Double>() {};
TypeDescriptor
for Doublepublic static TypeDescriptor<java.lang.Float> floats()
TypeDescriptor
for Float.
This is the equivalent of:
new TypeDescriptor<Float>() {};
TypeDescriptor
for Floatpublic static TypeDescriptor<java.lang.Integer> integers()
TypeDescriptor
for Integer.
This is the equivalent of:
new TypeDescriptor<Integer>() {};
TypeDescriptor
for Integerpublic static TypeDescriptor<java.lang.Long> longs()
TypeDescriptor
for Long.
This is the equivalent of:
new TypeDescriptor<Long>() {};
TypeDescriptor
for Longpublic static TypeDescriptor<java.lang.Short> shorts()
TypeDescriptor
for Short.
This is the equivalent of:
new TypeDescriptor<Short>() {};
TypeDescriptor
for Shortpublic static TypeDescriptor<java.math.BigDecimal> bigdecimals()
TypeDescriptor
for BigDecimal.
This is the equivalent of:
new TypeDescriptor<BigDecimal>() {};
TypeDescriptor
for BigDecimalpublic static TypeDescriptor<java.math.BigInteger> bigintegers()
TypeDescriptor
for BigInteger.
This is the equivalent of:
new TypeDescriptor<BigInteger>() {};
TypeDescriptor
for BigIntegerpublic static TypeDescriptor<java.lang.String> strings()
TypeDescriptor
for String.
This is the equivalent of:
new TypeDescriptor<String>() {};
TypeDescriptor
for Stringpublic static TypeDescriptor<java.lang.Character> characters()
TypeDescriptor
for Character.
This is the equivalent of:
new TypeDescriptor<Character>() {};
TypeDescriptor
for Characterpublic static TypeDescriptor<java.lang.Byte> bytes()
TypeDescriptor
for Byte.
This is the equivalent of:
new TypeDescriptor<Byte>() {};
TypeDescriptor
for Bytepublic static TypeDescriptor<java.lang.Void> nulls()
TypeDescriptor
for nulls/Void.
This is the equivalent of:
new TypeDescriptor<Void>() {};
TypeDescriptor
for nulls/Voidpublic static <K,V> TypeDescriptor<KV<K,V>> kvs(TypeDescriptor<K> key, TypeDescriptor<V> value)
TypeDescriptor
for KV
.
This is the equivalent of:
new TypeDescriptor<KV<K,V>>() {};
Example of use:
PCollection<String> words = ...;
PCollection<KV<String, String>> words = words.apply(FlatMapElements
.into(TypeDescriptors.kv(TypeDescriptors.strings(), TypeDescriptors.strings()))
.via(...));
key
- The TypeDescriptor
for the keyvalue
- The TypeDescriptor
for the valueTypeDescriptor
for KV
public static <T> TypeDescriptor<java.util.Set<T>> sets(TypeDescriptor<T> element)
TypeDescriptor
for Set
.
This is the equivalent of:
new TypeDescriptor<Set<E>>() {};
Example of use:
PCollection<String> words = ...;
PCollection<Set<String>> words = words.apply(FlatMapElements
.into(TypeDescriptors.sets(TypeDescriptors.strings()))
.via(...));
element
- The TypeDescriptor
for the setTypeDescriptor
for Set
public static <T> TypeDescriptor<java.util.List<T>> lists(TypeDescriptor<T> element)
TypeDescriptor
for List
.
This is the equivalent of:
new TypeDescriptor<List<E>>() {};
Example of use:
PCollection<String> words = ...;
PCollection<List<String>> words = words.apply(FlatMapElements
.into(TypeDescriptors.lists(TypeDescriptors.strings()))
.via(...));
element
- The TypeDescriptor
for the listTypeDescriptor
for List
public static <T> TypeDescriptor<java.lang.Iterable<T>> iterables(TypeDescriptor<T> iterable)
TypeDescriptor
for Iterable
.
This is the equivalent of:
new TypeDescriptor<Iterable<E>>() {};
Example of use:
PCollection<String> words = ...;
PCollection<Iterable<String>> words = words.apply(FlatMapElements
.into(TypeDescriptors.iterables(TypeDescriptors.strings()))
.via(...));
iterable
- The TypeDescriptor
for the iterableTypeDescriptor
for Iterable