// Copyright 2017 JanusGraph Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.janusgraph.graphdb.database.indexing; import org.janusgraph.core.attribute.Cmp; import org.janusgraph.core.attribute.Contain; import org.janusgraph.diskstorage.indexing.IndexFeatures; import org.janusgraph.diskstorage.indexing.IndexInformation; import org.janusgraph.diskstorage.indexing.KeyInformation; import org.janusgraph.graphdb.query.JanusGraphPredicate; /** * @author Matthias Broecheler (me@matthiasb.com) */ public class StandardIndexInformation implements IndexInformation { public static final StandardIndexInformation INSTANCE = new StandardIndexInformation(); private static final IndexFeatures STANDARD_FEATURES = new IndexFeatures.Builder().build(); private StandardIndexInformation() { } @Override public boolean supports(KeyInformation information, JanusGraphPredicate janusgraphPredicate) { return janusgraphPredicate == Cmp.EQUAL || janusgraphPredicate == Contain.IN; } @Override public boolean supports(KeyInformation information) { return true; } @Override public String mapKey2Field(String key, KeyInformation information) { return key; } @Override public IndexFeatures getFeatures() { return STANDARD_FEATURES; } }