Search in sources :

Example 1 with SchemaType

use of com.baidu.hugegraph.entity.schema.SchemaType in project incubator-hugegraph-toolchain by apache.

the class SchemaService method collectPropertyIndexes.

public static List<PropertyIndex> collectPropertyIndexes(SchemaLabel schemaLabel, List<IndexLabel> indexLabels) {
    List<PropertyIndex> propertyIndexes = new ArrayList<>();
    if (indexLabels == null) {
        return propertyIndexes;
    }
    for (IndexLabel indexLabel : indexLabels) {
        if (indexLabel.baseType().string().equals(schemaLabel.type()) && indexLabel.baseValue().equals(schemaLabel.name())) {
            SchemaType schemaType = SchemaType.convert(indexLabel.baseType());
            PropertyIndex propertyIndex;
            propertyIndex = new PropertyIndex(indexLabel.baseValue(), schemaType, indexLabel.name(), indexLabel.indexType(), indexLabel.indexFields());
            propertyIndexes.add(propertyIndex);
        }
    }
    return propertyIndexes;
}
Also used : IndexLabel(com.baidu.hugegraph.structure.schema.IndexLabel) ArrayList(java.util.ArrayList) PropertyIndex(com.baidu.hugegraph.entity.schema.PropertyIndex) SchemaType(com.baidu.hugegraph.entity.schema.SchemaType)

Aggregations

PropertyIndex (com.baidu.hugegraph.entity.schema.PropertyIndex)1 SchemaType (com.baidu.hugegraph.entity.schema.SchemaType)1 IndexLabel (com.baidu.hugegraph.structure.schema.IndexLabel)1 ArrayList (java.util.ArrayList)1