static IAttributeStore createStore()

in repository/src/main/java/org/apache/atlas/repository/memory/AttributeStores.java [51:94]


    static IAttributeStore createStore(AttributeInfo i) throws RepositoryException {
        switch (i.dataType().getTypeCategory()) {
        case PRIMITIVE:
            if (i.dataType() == DataTypes.BOOLEAN_TYPE) {
                return new BooleanAttributeStore(i);
            } else if (i.dataType() == DataTypes.BYTE_TYPE) {
                return new ByteAttributeStore(i);
            } else if (i.dataType() == DataTypes.SHORT_TYPE) {
                return new ShortAttributeStore(i);
            } else if (i.dataType() == DataTypes.INT_TYPE) {
                return new IntAttributeStore(i);
            } else if (i.dataType() == DataTypes.LONG_TYPE) {
                return new LongAttributeStore(i);
            } else if (i.dataType() == DataTypes.FLOAT_TYPE) {
                return new FloatAttributeStore(i);
            } else if (i.dataType() == DataTypes.DOUBLE_TYPE) {
                return new DoubleAttributeStore(i);
            } else if (i.dataType() == DataTypes.BIGINTEGER_TYPE) {
                return new BigIntStore(i);
            } else if (i.dataType() == DataTypes.BIGDECIMAL_TYPE) {
                return new BigDecimalStore(i);
            } else if (i.dataType() == DataTypes.DATE_TYPE) {
                return new DateStore(i);
            } else if (i.dataType() == DataTypes.STRING_TYPE) {
                return new StringStore(i);
            } else if (i.dataType() == DataTypes.STRING_TYPE) {
                return new StringStore(i);
            } else {
                throw new RepositoryException(String.format("Unknown datatype %s", i.dataType()));
            }
        case ENUM:
            return new IntAttributeStore(i);
        case ARRAY:
            return new ImmutableListStore(i);
        case MAP:
            return new ImmutableMapStore(i);
        case STRUCT:
            return new StructStore(i);
        case CLASS:
            return new IdStore(i);
        default:
            throw new RepositoryException(String.format("Unknown Category for datatype %s", i.dataType()));
        }
    }