Java Code Examples for org.apache.atlas.model.typedef.AtlasBaseTypeDef#getCategory()

The following examples show how to use org.apache.atlas.model.typedef.AtlasBaseTypeDef#getCategory() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AtlasTypeRegistry.java    From atlas with Apache License 2.0 6 votes vote down vote up
private void removeTypeByNameWithNoRefResolve(AtlasBaseTypeDef typeDef) {
    switch (typeDef.getCategory()) {
        case ENUM:
            registryData.enumDefs.removeTypeDefByName(typeDef.getName());
            break;
        case STRUCT:
            registryData.structDefs.removeTypeDefByName(typeDef.getName());
            break;
        case CLASSIFICATION:
            registryData.classificationDefs.removeTypeDefByName(typeDef.getName());
            break;
        case ENTITY:
            registryData.entityDefs.removeTypeDefByName(typeDef.getName());
            break;
        case RELATIONSHIP:
            registryData.relationshipDefs.removeTypeDefByName(typeDef.getName());
            break;
        case BUSINESS_METADATA:
            registryData.businessMetadataDefs.removeTypeDefByName(typeDef.getName());
            break;
    }
    deletedTypes.add(typeDef);
}
 
Example 2
Source File: AtlasTypeRegistry.java    From atlas with Apache License 2.0 6 votes vote down vote up
private void removeTypeByGuidWithNoRefResolve(AtlasBaseTypeDef typeDef) {
    switch (typeDef.getCategory()) {
        case ENUM:
            registryData.enumDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case STRUCT:
            registryData.structDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case CLASSIFICATION:
            registryData.classificationDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case ENTITY:
            registryData.entityDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case RELATIONSHIP:
            registryData.relationshipDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case BUSINESS_METADATA:
            registryData.businessMetadataDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
    }
    deletedTypes.add(typeDef);
}
 
Example 3
Source File: AtlasTypeDefGraphStoreV1.java    From incubator-atlas with Apache License 2.0 6 votes vote down vote up
TypeCategory getTypeCategory(AtlasBaseTypeDef typeDef) {
    switch (typeDef.getCategory()) {
        case ENTITY:
            return TypeCategory.CLASS;

        case CLASSIFICATION:
            return TypeCategory.TRAIT;

        case STRUCT:
            return TypeCategory.STRUCT;

        case ENUM:
            return TypeCategory.ENUM;

        case RELATIONSHIP:
            return TypeCategory.RELATIONSHIP;
    }

    return null;
}
 
Example 4
Source File: AtlasTypeRegistry.java    From incubator-atlas with Apache License 2.0 6 votes vote down vote up
private void removeTypeByNameWithNoRefResolve(AtlasBaseTypeDef typeDef) {
    switch (typeDef.getCategory()) {
        case ENUM:
            registryData.enumDefs.removeTypeDefByName(typeDef.getName());
            break;
        case STRUCT:
            registryData.structDefs.removeTypeDefByName(typeDef.getName());
            break;
        case CLASSIFICATION:
            registryData.classificationDefs.removeTypeDefByName(typeDef.getName());
            break;
        case ENTITY:
            registryData.entityDefs.removeTypeDefByName(typeDef.getName());
            break;
        case RELATIONSHIP:
            registryData.relationshipDefs.removeTypeDefByName(typeDef.getName());
            break;
    }
    deletedTypes.add(typeDef);
}
 
Example 5
Source File: AtlasTypeRegistry.java    From incubator-atlas with Apache License 2.0 6 votes vote down vote up
private void removeTypeByGuidWithNoRefResolve(AtlasBaseTypeDef typeDef) {
    switch (typeDef.getCategory()) {
        case ENUM:
            registryData.enumDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case STRUCT:
            registryData.structDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case CLASSIFICATION:
            registryData.classificationDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case ENTITY:
            registryData.entityDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
        case RELATIONSHIP:
            registryData.relationshipDefs.removeTypeDefByGuid(typeDef.getGuid());
            break;
    }
    deletedTypes.add(typeDef);
}
 
Example 6
Source File: AtlasType.java    From atlas with Apache License 2.0 4 votes vote down vote up
protected AtlasType(AtlasBaseTypeDef typeDef) {
    this(typeDef.getName(), typeDef.getCategory(), typeDef.getServiceType());
}
 
Example 7
Source File: AtlasType.java    From incubator-atlas with Apache License 2.0 4 votes vote down vote up
protected AtlasType(AtlasBaseTypeDef typeDef) {
    this(typeDef.getName(), typeDef.getCategory());
}