Class ItemParser
- java.lang.Object
-
- com.cognite.client.servicesV1.parser.ItemParser
-
public class ItemParser extends Object
This class contains a set of methods to help parsing item object between Cognite api representations (json and proto) and typed objects.
-
-
Constructor Summary
Constructors Constructor Description ItemParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.cognite.client.dto.ItemparseItem(String itemJson)Parses aString(json payload from the Cognite api) into anItemstatic List<com.cognite.client.dto.Item>parseItems(List<String> input)Parses aListof json items (payload from the Cognite api) into anListofItem.static Optional<Long>parseLong(String itemJson, String fieldName)Try parsing the specified Json path as aLong.static Optional<String>parseString(String itemJson, String fieldName)Try parsing the specified Json path as aString.static Map<String,Object>toRequestItem(com.cognite.client.dto.Item element)Builds a request item object fromItem.
-
-
-
Method Detail
-
parseItems
public static List<com.cognite.client.dto.Item> parseItems(List<String> input) throws Exception
Parses aListof json items (payload from the Cognite api) into anListofItem.- Parameters:
input-- Returns:
- Throws:
Exception
-
parseItem
public static com.cognite.client.dto.Item parseItem(String itemJson) throws Exception
Parses aString(json payload from the Cognite api) into anItem- Returns:
- Throws:
Exception
-
toRequestItem
public static Map<String,Object> toRequestItem(com.cognite.client.dto.Item element) throws Exception
Builds a request item object fromItem. An item object creates a new asset data object in the Cognite system.- Parameters:
element-- Returns:
- Throws:
Exception
-
-