}
}
- private boolean vertexLeftNotContainsAllRightProps(Map<String, Object> leftProps, Map<String, Object> rightProps) {
-
- if (rightProps != null) {
-
- for (Entry<String, Object> entry : rightProps.entrySet()) {
- String key = entry.getKey();
- Object leftValue = leftProps.get(key);
- Object rightValue = entry.getValue();
-
- if (leftValue == null) {
- if (rightValue == null) {
- return false;
- } else {
- continue;
- }
- }
-
- if (true == leftValue.equals(rightValue)) {
- logger.trace("The value of key {} is differnet between properties. {} vs {}", key, leftValue, rightValue);
- return false;
- }
- }
-
- }
-
- return true;
-
- }
-
public <T extends GraphNode> Either<List<T>, TitanOperationStatus> getByCriteria(NodeTypeEnum type, Map<String, Object> props, Class<T> clazz) {
Either<TitanGraph, TitanOperationStatus> graph = titanClient.getGraph();
if (graph.isLeft()) {
}
}
- private boolean vertexLeftContainsRightProps(Map<String, Object> leftProps, Map<String, Object> rightProps) {
-
- if (rightProps != null) {
-
- for (Entry<String, Object> entry : rightProps.entrySet()) {
- String key = entry.getKey();
- Object leftValue = leftProps.get(key);
- Object rightValue = entry.getValue();
- if (leftValue == null) {
- if (rightValue == null) {
- continue;
- } else {
- logger.debug("The key {} cannot be found in the properties {}", key, leftProps);
- return false;
- }
- }
-
- if (false == leftValue.equals(rightValue)) {
- logger.trace("The value of key {} is differnet between properties. {} vs {} ", key, leftValue, rightValue);
- return false;
- }
- }
-
- }
-
- return true;
- }
-
public <T extends GraphNode> Either<List<T>, TitanOperationStatus> getByCriteriaWithPredicate(NodeTypeEnum type, Map<String, Entry<TitanPredicate, Object>> props, Class<T> clazz) {
Either<TitanGraph, TitanOperationStatus> graph = titanClient.getGraph();
if (graph.isLeft()) {
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.TitanVertex;
import com.thinkaurelius.titan.core.attribute.Text;
-import com.thinkaurelius.titan.core.schema.ConsistencyModifier;
-import com.thinkaurelius.titan.core.schema.TitanGraphIndex;
import com.thinkaurelius.titan.core.schema.TitanManagement;
import fj.data.Either;