mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-14 03:26:47 +00:00
Co-authored-by: Dexter Lee <dexter@acryl.io> Co-authored-by: Gabe Lyons <itsgabelyons@gmail.com> Co-authored-by: Shirshanka Das <shirshanka@apache.org>
35 lines
914 B
Java
35 lines
914 B
Java
package com.linkedin.metadata.models;
|
|
|
|
import com.linkedin.data.schema.DataSchema;
|
|
import com.linkedin.data.schema.PathSpec;
|
|
import com.linkedin.metadata.models.annotation.RelationshipAnnotation;
|
|
import java.util.List;
|
|
import javax.annotation.Nonnull;
|
|
import lombok.NonNull;
|
|
import lombok.Value;
|
|
|
|
|
|
@Value
|
|
public class RelationshipFieldSpec implements FieldSpec {
|
|
|
|
@NonNull PathSpec path;
|
|
@NonNull RelationshipAnnotation relationshipAnnotation;
|
|
@NonNull DataSchema pegasusSchema;
|
|
|
|
/**
|
|
* Returns the name of the outbound relationship extending from the field.
|
|
*/
|
|
@Nonnull
|
|
public String getRelationshipName() {
|
|
return relationshipAnnotation.getName();
|
|
}
|
|
|
|
/**
|
|
* Returns a list of entity names representing the destination node type of the relationship.
|
|
*/
|
|
@Nonnull
|
|
public List<String> getValidDestinationTypes() {
|
|
return relationshipAnnotation.getValidDestinationTypes();
|
|
}
|
|
}
|