Class Deserialize
java.lang.Object
org.hansken.plugin.extraction.test.serialize.Deserialize
Utility methods for deserializing the input of an
ExtractionPlugin, for use in the
Flits test framework.
TODO deserialize all property types, how? (e.g. time zone, based on model?? based on string format??)-
Method Summary
Modifier and TypeMethodDescriptionstatic org.hansken.plugin.extraction.runtime.grpc.client.api.ClientDataContextcontextFromRandomAccessData(Path dataFile) Create a context from aRandomAccessFileData.static StringextractDataType(Path dataFilePath) static SearchTracesearchTraceFromJson(Path jsonFile) Create aSearchTracedescribed by the JSON string.static org.hansken.plugin.extraction.runtime.grpc.client.api.ClientTracetraceFromJson(Path jsonFile) Create aTracedescribed by the JSON in the file pointed to by given path.static TraceSearchertraceSearcherFromData(Path tracePath) Create a trace searcher with files residing in the directory pointed to by the given path.
-
Method Details
-
traceFromJson
public static org.hansken.plugin.extraction.runtime.grpc.client.api.ClientTrace traceFromJson(Path jsonFile) Create aTracedescribed by the JSON in the file pointed to by given path.The JSON is expected to contain a single
tracefield, which is an object containing an object field per type. Each object field then contains the properties of the trace for that type.- Parameters:
jsonFile- the file to read from- Returns:
- the deserialized trace
-
searchTraceFromJson
Create aSearchTracedescribed by the JSON string.The JSON is expected to contain a single
tracefield, which is an object containing an object field per type. Each object field then contains the properties of the trace for that type.- Parameters:
jsonFile- the file to read from- Returns:
- the deserialized trace
- Throws:
IOException- when an I/O error occurs or when given input file does not exist
-
contextFromRandomAccessData
public static org.hansken.plugin.extraction.runtime.grpc.client.api.ClientDataContext contextFromRandomAccessData(Path dataFile) throws IOException Create a context from aRandomAccessFileData.- Parameters:
dataFile- path to the data- Returns:
- the created data context
- Throws:
IOException- when the path is incorrect
-
traceSearcherFromData
Create a trace searcher with files residing in the directory pointed to by the given path.- Parameters:
tracePath- the directory whose children will be used- Returns:
- the created trace searcher
-
extractDataType
-