| Modifier and Type | Class and Description |
|---|---|
static class |
Convert.ResolvableLink
A special class that is used to indicate that the record(s) to which one
or more
links should point must be resolved by finding all
records that match a criteria. |
| Modifier and Type | Method and Description |
|---|---|
static List<Multimap<String,Object>> |
anyJsonToJava(String json)
Takes a JSON string representation of an object or an array of JSON
objects and returns a list of
multimaps with the
corresponding data. |
static List<TObject> |
javaListToThrift(List<Object> objects)
Return a List that represents the Thrift representation of each of the
objects in the input list. |
static <K> Map<K,TObject> |
javaMapToThrift(Map<K,Object> objects)
Return a Map that represents the Thrift representation of each of the
objects in the input Map. |
static Set<TObject> |
javaSetToThrift(Set<Object> objects)
Return a Set that represents the Thrift representation of each of the
objects in the input Set. |
static TObject |
javaToThrift(Object object)
Return the Thrift Object that represents
object. |
static Multimap<String,Object> |
jsonToJava(String json)
Convert a JSON formatted string to a mapping that associates each key
with the Java objects that represent the corresponding values.
|
static String |
mapsToJson(Collection<Multimap<String,Object>> list)
Serialize the
list of maps with data to a JSON
string that can be batch inserted into Concourse. |
static String |
mapToJson(Map<String,?> map)
Serialize the
map of data as a JSON object string that can be
inserted into Concourse. |
static String |
mapToJson(Multimap<String,Object> map)
Serialize the
map of a data as a JSON string that can inserted
into Concourse. |
static String |
operatorToString(Operator operator)
Convert the
operator to a string representation. |
static <T> T |
possibleThriftToJava(Object tobject)
For a scalar object that may be a
TObject or a collection of
other objects that may contain TObjects, convert to the
appropriate java representation. |
static Object |
stringToJava(String value)
Analyze
value and convert it to the appropriate Java primitive or
Object. |
static Operator |
stringToOperator(String symbol)
Convert the
symbol into the appropriate Operator. |
static String |
stringToResolvableLinkInstruction(String ccl)
Users are encouraged to use
Link.toWhere(String) instead of this
method. |
static String |
stringToResolvableLinkSpecification(String key,
String rawValue)
Deprecated.
|
static Set<Object> |
thriftSetToJava(Set<TObject> tobjects)
Return a Set that represents the Java representation of each of the
TObjects in the input Set. |
static Object |
thriftToJava(TObject object)
Return the Java Object that represents
object. |
public static List<Multimap<String,Object>> anyJsonToJava(String json)
multimaps with the
corresponding data. Unlike jsonToJava(String), this method will
allow the top level element to be an array in the {code json} string.json - public static List<TObject> javaListToThrift(List<Object> objects)
objects in the input list.objects - a List of java objectspublic static <K> Map<K,TObject> javaMapToThrift(Map<K,Object> objects)
objects in the input Map.objects - a Map of java objectspublic static Set<TObject> javaSetToThrift(Set<Object> objects)
objects in the input Set.objects - a Set of java objectspublic static TObject javaToThrift(Object object)
object.object - public static Multimap<String,Object> jsonToJava(String json)
This method can properly handle JSON strings that abide by the following rules:
json - public static String mapsToJson(Collection<Multimap<String,Object>> list)
list of maps with data to a JSON
string that can be batch inserted into Concourse.list - the list of data maps to include in the JSON
object. This is meant to map to the return value of
anyJsonToJava(String)listpublic static String mapToJson(Map<String,?> map)
map of data as a JSON object string that can be
inserted into Concourse.map - data to include in the JSON object.mappublic static String mapToJson(Multimap<String,Object> map)
map of a data as a JSON string that can inserted
into Concourse.map - the data to include in the JSON object. This is meant to map
to the return value of jsonToJava(String)mappublic static String operatorToString(Operator operator)
operator to a string representation.operator - public static <T> T possibleThriftToJava(Object tobject)
TObject or a collection of
other objects that may contain TObjects, convert to the
appropriate java representation.tobject - the possible TObject or collection of TObjectspublic static Object stringToJava(String value)
value and convert it to the appropriate Java primitive or
Object.
Convert.ResolvableLink - the value is converted to a
ResolvableLink if it is a properly formatted specification returned from
the stringToResolvableLinkSpecification(String, String) method
(NOTE: this is a rare case)Link - the value is converted to a Link if
it is an int or long that is prepended by an '@' sign (i.e. @1234)value - public static Operator stringToOperator(String symbol)
symbol into the appropriate Operator.symbol - - the string form of a symbol (i.e. =, >, >=, etc) or a
CaSH shortcut (i.e. eq, gt, gte, etc)Operator that is parsed from the string
symbolpublic static String stringToResolvableLinkInstruction(String ccl)
Users are encouraged to use Link.toWhere(String) instead of this
method.
USE WITH CAUTION: This conversation is only necessary when bulk inserting data in string form (i.e. importing data from a CSV file) that should have static links dynamically resolved. Unless you are certain otherwise, you should never need to use this method because there is probably some intermediate function or framework that does this for you!
Convert the ccl string to a Convert.ResolvableLink instruction
for the receiver to add links to all the records that match the criteria.
Please note that this method only returns a specification and not an
actual Convert.ResolvableLink object. Use the
stringToJava(String) method on the value returned from this
method to get the object.
ccl - - The criteria to use when resolving link targetsConvert.ResolvableLink@Deprecated public static String stringToResolvableLinkSpecification(String key, String rawValue)
USE WITH CAUTION: This conversation is only necessary for applications that import raw data but cannot use the Concourse API directly and therefore cannot explicitly add links (e.g. the import-framework that handles raw string data). If you have access to the Concourse API, you should not use this method!
Convert therawValue into a Convert.ResolvableLink specification
that instructs the receiver to add a link to all the records that have
rawValue mapped from key.
Please note that this method only returns a specification and not an
actual Convert.ResolvableLink object. Use the
stringToJava(String) method on the value returned from this
method to get the object.
key - rawValue - public static Set<Object> thriftSetToJava(Set<TObject> tobjects)
TObjects in the input Set.objects - a Set of TObjectspublic static Object thriftToJava(TObject object)
object.object -