Class RelationshipParser


  • public class RelationshipParser
    extends Object
    This class contains a set of methods to help parsing relationship objects between Cognite api representations (json and proto) and typed objects.
    • Constructor Detail

      • RelationshipParser

        public RelationshipParser()
    • Method Detail

      • parseRelationship

        public static com.cognite.client.dto.Relationship parseRelationship​(String json)
                                                                     throws Exception
        Parses a relationship json string to Relationship proto object.
        Parameters:
        json -
        Returns:
        Throws:
        Exception
      • toRequestInsertItem

        public static Map<String,​Object> toRequestInsertItem​(com.cognite.client.dto.Relationship element)
        Builds a request insert item object from Relationship. An insert item object creates a new asset data object in the Cognite system.
        Parameters:
        element -
        Returns:
      • toRequestUpdateItem

        public static Map<String,​Object> toRequestUpdateItem​(com.cognite.client.dto.Relationship element)
        Builds a request update item object from Relationship. An update item object updates an existing relationship 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​(com.cognite.client.dto.Relationship element)
        Builds a request replace item object from Relationship. 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:
      • toString

        public static String toString​(com.cognite.client.dto.Relationship.ResourceType resourceType)
        Returns the string representation of a relationship reference resource type.
        Parameters:
        resourceType -
        Returns:
      • parseResourceType

        public static Optional<com.cognite.client.dto.Relationship.ResourceType> parseResourceType​(String type)
        Tries to parse a string into a ResourceType. If the string cannot be parsed, the returned Optional will be empty.
        Parameters:
        type -
        Returns: