BasicRelationship Class
- java.
lang. Object - com.
azure. digitaltwins. core. BasicRelationship
- com.
public final class BasicRelationship
Although relationships have a user-defined schema, these properties should exist on every instance. This is useful to use as a base class to ensure your custom relationships have the necessary properties.
Note that this class uses JsonProperty from the Jackson serialization library. Because of this, this type will only work if the default json serializer is used by the digital twins client or if the custom json serializer uses Jackson as well. In order to use a different json library, a new BasicRelationship class must be constructed and have its json properties tagged by the annotation used by that json library.
Constructor Summary
Constructor | Description |
---|---|
BasicRelationship(String relationshipId, String sourceDigitalTwinId, String targetDigitalTwinId, String relationshipName) |
Construct a basic digital twin relationship. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Basic |
addProperty(String key, Object value)
Adds an additional custom property to this model. |
String |
getETag()
Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232. |
String |
getId()
Gets the unique Id of the relationship. |
String |
getName()
Gets the name of the relationship, which defines the type of link (e. |
Map<String,Object> |
getProperties()
Gets the additional custom properties defined in the model. |
String |
getSourceId()
Gets the unique Id of the source digital twin. |
String |
getTargetId()
Gets the unique Id of the target digital twin. |
Basic |
setETag(String etag)
Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232. |
Methods inherited from java.lang.Object
Constructor Details
BasicRelationship
public BasicRelationship(String relationshipId, String sourceDigitalTwinId, String targetDigitalTwinId, String relationshipName)
Construct a basic digital twin relationship.
Parameters:
Method Details
addProperty
public BasicRelationship addProperty(String key, Object value)
Adds an additional custom property to this model. This field will contain any properties of the relationship that are not already defined by the other strong types of this class.
Parameters:
Returns:
getETag
public String getETag()
Gets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
Returns:
getId
public String getId()
Gets the unique Id of the relationship. This field is present on every relationship.
Returns:
getName
public String getName()
Gets the name of the relationship, which defines the type of link (e.g. Contains). This field is present on every relationship.
Returns:
getProperties
public Map
Gets the additional custom properties defined in the model. This field will contain any properties of the relationship that are not already defined by the other strong types of this class.
Returns:
getSourceId
public String getSourceId()
Gets the unique Id of the source digital twin. This field is present on every relationship.
Returns:
getTargetId
public String getTargetId()
Gets the unique Id of the target digital twin. This field is present on every relationship.
Returns:
setETag
public BasicRelationship setETag(String etag)
Sets a string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.
Parameters:
Returns:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for