John Joyce 97e9660037
feat: No Code Metadata Modeling (#2629)
Co-authored-by: Dexter Lee <dexter@acryl.io>
Co-authored-by: Gabe Lyons <itsgabelyons@gmail.com>
Co-authored-by: Shirshanka Das <shirshanka@apache.org>
2021-06-03 13:24:33 -07:00

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();
}
}