Class GafferCustomTypeFactory
- java.lang.Object
-
- uk.gov.gchq.gaffer.tinkerpop.process.traversal.util.GafferCustomTypeFactory
-
public final class GafferCustomTypeFactory extends Object
Class that helps the conversion between Gaffer custom types and standard types that Tinkerpop supports. Tinkerpop only supports a limited number of types so any custom Gaffer ones can only be passed as String representations via Gremlin so need conversion before using in Gaffer Operation chains.
-
-
Field Summary
Fields Modifier and Type Field Description static List<Class<?>>GRAPHSONV3_TYPES
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectparseAsCustomTypeIfValid(Object value)Returns a the relevant Object e.g.static ObjectparseForGraphSONv3(Object value)Parses the given value to make sure it can be used with Tinkerpops GraphSONv3 types.
-
-
-
Method Detail
-
parseAsCustomTypeIfValid
public static Object parseAsCustomTypeIfValid(Object value)
Returns a the relevant Object e.g.TypeSubTypeValuefrom the supplied value or ID, usually by parsing a specifically formatted string. As a fallback will give back the original value if no relevant type was found."TypeSubTypeValue[type=alpha,subType=beta,value=gamma]" // returns TypeSubTypeValue object "[type=alpha,subType=beta,value=gamma]" // returns TypeSubTypeValue object "normalvalue" // returns itself
- Parameters:
value- The value.- Returns:
- The value as its relevant type.
-
parseForGraphSONv3
public static Object parseForGraphSONv3(Object value)
Parses the given value to make sure it can be used with Tinkerpops GraphSONv3 types. Will convert the value to String representation if type is not compatible or if value is a collection it will convert all the values inside it.- Parameters:
value- The value to parse.- Returns:
- The value in compatible format.
-
-