Class EventParser
- java.lang.Object
-
- com.cognite.client.servicesV1.parser.EventParser
-
public class EventParser extends Object
This class contains a set of methods to help parsing file objects between Cognite api representations (json and proto) and typed objects.
-
-
Constructor Summary
Constructors Constructor Description EventParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EventparseEvent(String json)Parses an event json string toEventproto object.static Map<String,Object>toRequestInsertItem(Event element)Builds a request insert item object fromEvent.static Map<String,Object>toRequestReplaceItem(Event element)Builds a request update replace item object fromEvent.static Map<String,Object>toRequestUpdateItem(Event element)Builds a request update item object fromEvent.
-
-
-
Method Detail
-
parseEvent
public static Event parseEvent(String json) throws Exception
Parses an event json string toEventproto object.- Parameters:
json-- Returns:
- Throws:
Exception
-
toRequestInsertItem
public static Map<String,Object> toRequestInsertItem(Event element) throws Exception
Builds a request insert item object fromEvent. An insert item object creates a new Event data object in the Cognite system.- Parameters:
element-- Returns:
- Throws:
Exception
-
toRequestUpdateItem
public static Map<String,Object> toRequestUpdateItem(Event element)
Builds a request update item object fromEvent. An update item object updates an existing event object with new values for all provided fields. Fields that are not in the update object retain their original value.- Parameters:
element-- Returns:
-
toRequestReplaceItem
public static Map<String,Object> toRequestReplaceItem(Event element)
Builds a request update replace item object fromEvent. A replace item object replaces an existing event object with new values for all provided fields. Fields that are not in the update object are set to null.- Parameters:
element-- Returns:
-
-