Class RelationshipParser

java.lang.Object
com.cognite.client.servicesV1.parser.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 Details

    • RelationshipParser

      public RelationshipParser()
  • Method Details

    • parseRelationship

      public static 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(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(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(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(Relationship.ResourceType resourceType)
      Returns the string representation of a relationship reference resource type.
      Parameters:
      resourceType -
      Returns:
    • parseResourceType

      public static Optional<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: