Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
*
* * Copyright 2010-2016 OrientDB LTD (http://orientdb.com)
* *
* * 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.
* *
* * For more information: http://orientdb.com
*
*/
package com.orientechnologies.orient.core.index;
import com.orientechnologies.orient.core.db.record.OMultiValueChangeEvent;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.core.record.impl.ODocument;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Index implementation bound to one schema class property that presents {@link com.orientechnologies.orient.core.metadata.schema.OType#EMBEDDEDMAP
* or
*
* @link com.orientechnologies.orient.core.metadata.schema.OType#LINKMAP} property.
*/
public class OPropertyMapIndexDefinition extends OAbstractIndexDefinitionMultiValue {
private static final long serialVersionUID = 275241019910834466L;
/** Indicates whether Map will be indexed using its keys or values. */
public static enum INDEX_BY {
KEY,
VALUE
}
private INDEX_BY indexBy = INDEX_BY.KEY;
public OPropertyMapIndexDefinition() {}
public OPropertyMapIndexDefinition(
final String iClassName, final String iField, final OType iType, final INDEX_BY indexBy) {
super(iClassName, iField, iType);
if (indexBy == null)
throw new NullPointerException(
"You have to provide way by which map entries should be mapped");
this.indexBy = indexBy;
}
@Override
public Object getDocumentValueToIndex(ODocument iDocument) {
return createValue(iDocument.