Class AssetParser
- java.lang.Object
-
- com.cognite.client.servicesV1.parser.AssetParser
-
public class AssetParser 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 AssetParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Asset
parseAsset(String json)
Parses an event json string toAsset
proto object.static Map<String,Object>
toRequestInsertItem(Asset element)
Builds a request insert item object fromAsset
.static Map<String,Object>
toRequestReplaceItem(Asset element)
Builds a request insert item object fromAsset
.static Map<String,Object>
toRequestUpdateItem(Asset element)
Builds a request update item object fromAsset
.
-
-
-
Method Detail
-
parseAsset
public static Asset parseAsset(String json) throws Exception
Parses an event json string toAsset
proto object.- Parameters:
json
-- Returns:
- Throws:
Exception
-
toRequestInsertItem
public static Map<String,Object> toRequestInsertItem(Asset element)
Builds a request insert item object fromAsset
. An insert item object creates a new asset data object in the Cognite system.- Parameters:
element
-- Returns:
-
toRequestUpdateItem
public static Map<String,Object> toRequestUpdateItem(Asset element)
Builds a request update item object fromAsset
. An update item object updates an existing asset 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(Asset element)
Builds a request insert item object fromAsset
. 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:
-
-