private static TypesDef classificationToTypesDef(AtlasClassificationType classificationType, AtlasTypeRegistry registry) { String typeName = classificationType.getClassificationDef().getName(); String typeDesc = classificationType.getClassificationDef().getDescription(); String typeVersion = classificationType.getClassificationDef().getTypeVersion(); Set<String> superTypes = new HashSet<>(classificationType.getClassificationDef().getSuperTypes()); List<AttributeDefinition> attributes = getAttributes(classificationType, registry); TraitTypeDefinition traitTypeDef = new TraitTypeDefinition(typeName, typeDesc, typeVersion, attributes, superTypes); TypesDef ret = new TypesDef(null, null, Arrays.asList(traitTypeDef), null); return ret; }
private AtlasBaseTypeDef getTypeDefFromType(AtlasType type) throws AtlasBaseException { AtlasBaseTypeDef ret; switch (type.getTypeCategory()) { case ENUM: ret = ((AtlasEnumType) type).getEnumDef(); break; case STRUCT: ret = ((AtlasStructType) type).getStructDef(); break; case CLASSIFICATION: ret = ((AtlasClassificationType) type).getClassificationDef(); break; case ENTITY: ret = ((AtlasEntityType) type).getEntityDef(); break; case PRIMITIVE: case OBJECT_ID_TYPE: case ARRAY: case MAP: default: throw new AtlasBaseException(AtlasErrorCode.SYSTEM_TYPE, type.getTypeCategory().name()); } return ret; }
typesDef.getClassificationDefs().add(classificationType.getClassificationDef());
private AtlasBaseTypeDef getTypeDefFromType(AtlasType type) throws AtlasBaseException { AtlasBaseTypeDef ret; switch (type.getTypeCategory()) { case ENUM: ret = ((AtlasEnumType) type).getEnumDef(); break; case STRUCT: ret = ((AtlasStructType) type).getStructDef(); break; case CLASSIFICATION: ret = ((AtlasClassificationType) type).getClassificationDef(); break; case ENTITY: ret = ((AtlasEntityType) type).getEntityDef(); break; case RELATIONSHIP: ret = ((AtlasRelationshipType) type).getRelationshipDef(); break; case PRIMITIVE: case OBJECT_ID_TYPE: case ARRAY: case MAP: default: throw new AtlasBaseException(AtlasErrorCode.SYSTEM_TYPE, type.getTypeCategory().name()); } return ret; }