public abstract class FormatLib extends Object
Modifier and Type | Field and Description |
---|---|
static Format<Boolean> |
boolFlagFormat
A Boolean format using 0 or 1.
|
static Format<Boolean> |
boolJsonFormat
A Boolean format using true or false.
|
static Format<Double> |
doubleFormat
A Double format using Double.parseDouble.
|
static Format<Float> |
floatFormat
A Float format using Float.parseFloat.
|
static Format<com.google.common.collect.ImmutableList<Integer>> |
intCommaListFormat
An Integer ImmutableList format with comma delimiters.
|
static Format<com.google.common.collect.ImmutableSet<Integer>> |
intCommaSetFormat
An Integer ImmutableSet format with comma delimiters.
|
static Format<Integer> |
intFormat
An Integer format using Integer.parseInt.
|
static Format<com.google.common.collect.ImmutableList<String>> |
strCommaListFormat
A String ImmutableList format with comma delimiters.
|
static Format<com.google.common.collect.ImmutableSet<String>> |
strCommaSetFormat
A String ImmutableSet format with comma delimiters.
|
static Format<String> |
strFormat
A String format which is a pass through (no-op).
|
static Format<com.google.common.collect.ImmutableSetMultimap<String,String>> |
strMultimapFormat
An ImmutableSetMultimap format with String keys and values, with comma delimited entries, and
with equal delimiting the key and value of an entry.
|
Constructor and Description |
---|
FormatLib() |
Modifier and Type | Method and Description |
---|---|
static <A,B> Format<B> |
chain(Format<A> format,
Translator<A,B> translator)
Chain together a format and a translator to create the combined format.
|
static <Item> Format<com.google.common.collect.ImmutableList<Item>> |
genListFormat(Format<Item> itemFormat,
String delimiter)
A function for creating List formats.
|
static <Item> Format<com.google.common.collect.ImmutableSet<Item>> |
genSetFormat(Format<Item> itemFormat,
String delimiter)
A function for creating Set formats.
|
static com.google.common.collect.ImmutableList<String> |
parseList(String string)
A function for parsing String ImmutableLists which is more convenient than writing
ImmutableList.of("a", "b", ...).
|
static com.google.common.collect.ImmutableSetMultimap<String,String> |
parseMultimap(String string)
A function for parsing ImmutableSetMultimaps with String keys and values, which is more
convenient than writing ImmutableSetMultimap.of("a", "b", ...).
|
static com.google.common.collect.ImmutableSet<String> |
parseSet(String string)
A function for parsing String ImmutableSets which is more convenient than writing
ImmutableSet.of("a", "b", ...).
|
public static Format<com.google.common.collect.ImmutableSet<String>> strCommaSetFormat
public static Format<com.google.common.collect.ImmutableSet<Integer>> intCommaSetFormat
public static Format<com.google.common.collect.ImmutableList<String>> strCommaListFormat
public static Format<com.google.common.collect.ImmutableList<Integer>> intCommaListFormat
public static <A,B> Format<B> chain(Format<A> format, Translator<A,B> translator)
public static <Item> Format<com.google.common.collect.ImmutableSet<Item>> genSetFormat(Format<Item> itemFormat, String delimiter)
public static com.google.common.collect.ImmutableSet<String> parseSet(String string)
public static <Item> Format<com.google.common.collect.ImmutableList<Item>> genListFormat(Format<Item> itemFormat, String delimiter)
public static com.google.common.collect.ImmutableList<String> parseList(String string)
Copyright © 2014. All rights reserved.