use of org.apache.atlas.v1.model.typedef.ClassTypeDefinition in project atlas by apache.
the class AtlasTypeUtil method toClassTypeDefinition.
public static ClassTypeDefinition toClassTypeDefinition(final AtlasEntityType entityType) {
ClassTypeDefinition ret = null;
if (entityType != null) {
AtlasEntityDef entityDef = entityType.getEntityDef();
ret = new ClassTypeDefinition();
ret.setTypeName(entityDef.getName());
ret.setTypeDescription(entityDef.getDescription());
ret.setTypeVersion(entityDef.getTypeVersion());
ret.setSuperTypes(entityDef.getSuperTypes());
if (MapUtils.isNotEmpty(entityType.getAllAttributes())) {
List<AttributeDefinition> attributeDefinitions = entityType.getAllAttributes().entrySet().stream().map(e -> toV1AttributeDefinition(e.getValue())).collect(Collectors.toList());
ret.setAttributeDefinitions(attributeDefinitions);
}
}
return ret;
}
Aggregations