com.thinkaurelius.titan.graphdb.query.QueryUtil.extractOrCondition()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中com.thinkaurelius.titan.graphdb.query.QueryUtil.extractOrCondition方法的一些代码示例,展示了QueryUtil.extractOrCondition的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryUtil.extractOrCondition方法的具体详情如下:
包路径:com.thinkaurelius.titan.graphdb.query.QueryUtil
类名称:QueryUtil
方法名:extractOrCondition

QueryUtil.extractOrCondition介绍

暂无

代码示例

代码示例来源:origin: thinkaurelius/titan

private static final Map.Entry<Condition,Collection<Object>> getEqualityConditionValues(Condition<TitanElement> condition, RelationType type) {
  for (Condition c : condition.getChildren()) {
    if (c instanceof Or) {
      Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)c);
      if (orEqual!=null && orEqual.getKey().equals(type) && !orEqual.getValue().isEmpty()) {
        return new AbstractMap.SimpleImmutableEntry(c,orEqual.getValue());
      }
    } else if (c instanceof PredicateCondition) {
      PredicateCondition<RelationType, TitanRelation> atom = (PredicateCondition)c;
      if (atom.getKey().equals(type) && atom.getPredicate()==Cmp.EQUAL && atom.getValue()!=null) {
        return new AbstractMap.SimpleImmutableEntry(c,ImmutableList.of(atom.getValue()));
      }
    }
  }
  return null;
}

代码示例来源:origin: thinkaurelius/titan

Interval newInterval=null;
if (condition instanceof Or) {
  Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)condition);
  if (orEqual!=null) {
    type = orEqual.getKey();

代码示例来源:origin: org.hawkular.titan/titan-core

private static final Map.Entry<Condition,Collection<Object>> getEqualityConditionValues(Condition<TitanElement> condition, RelationType type) {
  for (Condition c : condition.getChildren()) {
    if (c instanceof Or) {
      Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)c);
      if (orEqual!=null && orEqual.getKey().equals(type) && !orEqual.getValue().isEmpty()) {
        return new AbstractMap.SimpleImmutableEntry(c,orEqual.getValue());
      }
    } else if (c instanceof PredicateCondition) {
      PredicateCondition<RelationType, TitanRelation> atom = (PredicateCondition)c;
      if (atom.getKey().equals(type) && atom.getPredicate()==Cmp.EQUAL && atom.getValue()!=null) {
        return new AbstractMap.SimpleImmutableEntry(c,ImmutableList.of(atom.getValue()));
      }
    }
  }
  return null;
}

代码示例来源:origin: com.thinkaurelius.titan/titan-core

private static final Map.Entry<Condition,Collection<Object>> getEqualityConditionValues(Condition<TitanElement> condition, RelationType type) {
  for (Condition c : condition.getChildren()) {
    if (c instanceof Or) {
      Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)c);
      if (orEqual!=null && orEqual.getKey().equals(type) && !orEqual.getValue().isEmpty()) {
        return new AbstractMap.SimpleImmutableEntry(c,orEqual.getValue());
      }
    } else if (c instanceof PredicateCondition) {
      PredicateCondition<RelationType, TitanRelation> atom = (PredicateCondition)c;
      if (atom.getKey().equals(type) && atom.getPredicate()==Cmp.EQUAL && atom.getValue()!=null) {
        return new AbstractMap.SimpleImmutableEntry(c,ImmutableList.of(atom.getValue()));
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.atlas/atlas-titan

private static final Map.Entry<Condition,Collection<Object>> getEqualityConditionValues(Condition<TitanElement> condition, RelationType type) {
  for (Condition c : condition.getChildren()) {
    if (c instanceof Or) {
      Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)c);
      if (orEqual!=null && orEqual.getKey().equals(type) && !orEqual.getValue().isEmpty()) {
        return new AbstractMap.SimpleImmutableEntry(c,orEqual.getValue());
      }
    } else if (c instanceof PredicateCondition) {
      PredicateCondition<RelationType, TitanRelation> atom = (PredicateCondition)c;
      if (atom.getKey().equals(type) && atom.getPredicate()==Cmp.EQUAL && atom.getValue()!=null) {
        return new AbstractMap.SimpleImmutableEntry(c,ImmutableList.of(atom.getValue()));
      }
    }
  }
  return null;
}

代码示例来源:origin: apache/incubator-atlas

private static final Map.Entry<Condition, Collection<Object>> getEqualityConditionValues(Condition<TitanElement> condition, RelationType type) {
  for (Condition c : condition.getChildren()) {
    if (c instanceof Or) {
      Map.Entry<RelationType, Collection> orEqual = QueryUtil.extractOrCondition((Or)c);
      if (orEqual!=null && orEqual.getKey().equals(type) && !orEqual.getValue().isEmpty()) {
        return new AbstractMap.SimpleImmutableEntry(c, orEqual.getValue());
      }
    } else if (c instanceof PredicateCondition) {
      PredicateCondition<RelationType, TitanRelation> atom = (PredicateCondition)c;
      if (atom.getKey().equals(type) && atom.getPredicate()==Cmp.EQUAL && atom.getValue()!=null) {
        return new AbstractMap.SimpleImmutableEntry(c, ImmutableList.of(atom.getValue()));
      }
    }
  }
  return null;
}

代码示例来源:origin: com.thinkaurelius.titan/titan-core

Interval newInterval=null;
if (condition instanceof Or) {
  Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)condition);
  if (orEqual!=null) {
    type = orEqual.getKey();

代码示例来源:origin: org.hawkular.titan/titan-core

Interval newInterval=null;
if (condition instanceof Or) {
  Map.Entry<RelationType,Collection> orEqual = QueryUtil.extractOrCondition((Or)condition);
  if (orEqual!=null) {
    type = orEqual.getKey();

相关文章