本文整理匯總了Java中com.redhat.lightblue.query.UnaryLogicalOperator._not方法的典型用法代碼示例。如果您正苦於以下問題:Java UnaryLogicalOperator._not方法的具體用法?Java UnaryLogicalOperator._not怎麽用?Java UnaryLogicalOperator._not使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.redhat.lightblue.query.UnaryLogicalOperator
的用法示例。
在下文中一共展示了UnaryLogicalOperator._not方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: rewrite
import com.redhat.lightblue.query.UnaryLogicalOperator; //導入方法依賴的package包/類
@Override
public QueryExpression rewrite(QueryExpression q) {
UnaryLogicalExpression le = dyncast(UnaryLogicalExpression.class, q);
if (le != null && le.getOp() == UnaryLogicalOperator._not) {
ValueComparisonExpression vce = dyncast(ValueComparisonExpression.class, le.getQuery());
if (vce != null) {
return new ValueComparisonExpression(vce.getField(), vce.getOp().negate(), vce.getRvalue());
} else {
FieldComparisonExpression fce = dyncast(FieldComparisonExpression.class, le.getQuery());
if (fce != null) {
return new FieldComparisonExpression(fce.getField(), fce.getOp().negate(), fce.getRfield());
} else {
NaryValueRelationalExpression nre = dyncast(NaryValueRelationalExpression.class, le.getQuery());
if (nre != null) {
return new NaryValueRelationalExpression(nre.getField(), nre.getOp().negate(), nre.getValues());
} else {
NaryFieldRelationalExpression nfe = dyncast(NaryFieldRelationalExpression.class, le.getQuery());
if (nfe != null) {
return new NaryFieldRelationalExpression(nfe.getField(), nfe.getOp().negate(), nfe.getRfield());
}
}
}
}
}
return q;
}
示例2: testbuild_UnaryLogicalExpression_NOT
import com.redhat.lightblue.query.UnaryLogicalOperator; //導入方法依賴的package包/類
@Test
public void testbuild_UnaryLogicalExpression_NOT(){
QueryExpression query = new UnaryLogicalExpression(
UnaryLogicalOperator._not,
new ValueComparisonExpression(new Path("somekey"), BinaryComparisonOperator._eq, new Value("somevalue")));
Filter filter = new FilterBuilder(new TrivialLdapFieldNameTranslator()).build(query);
assertEquals("(!(somekey=somevalue))", filter.toString());
}
示例3: rewrite
import com.redhat.lightblue.query.UnaryLogicalOperator; //導入方法依賴的package包/類
@Override
public QueryExpression rewrite(QueryExpression q) {
UnaryLogicalExpression le = dyncast(UnaryLogicalExpression.class, q);
if (le != null && le.getOp() == UnaryLogicalOperator._not) {
NaryLogicalExpression oreq = dyncast(NaryLogicalExpression.class, le.getQuery());
if (oreq != null && oreq.getOp() == NaryLogicalOperator._or) {
List<QueryExpression> newList = new ArrayList<>(oreq.getQueries().size());
for (QueryExpression x : oreq.getQueries()) {
newList.add(new UnaryLogicalExpression(UnaryLogicalOperator._not, x));
}
return new NaryLogicalExpression(NaryLogicalOperator._and, newList);
}
}
return q;
}
示例4: rewrite
import com.redhat.lightblue.query.UnaryLogicalOperator; //導入方法依賴的package包/類
@Override
public QueryExpression rewrite(QueryExpression q) {
UnaryLogicalExpression le = dyncast(UnaryLogicalExpression.class, q);
if (le != null && le.getOp() == UnaryLogicalOperator._not) {
UnaryLogicalExpression oreq = dyncast(UnaryLogicalExpression.class, le.getQuery());
if (oreq != null && oreq.getOp() == UnaryLogicalOperator._not) {
return oreq.getQuery();
}
}
return q;
}
示例5: _not
import com.redhat.lightblue.query.UnaryLogicalOperator; //導入方法依賴的package包/類
private QueryExpression _not(QueryExpression q) {
return new UnaryLogicalExpression(UnaryLogicalOperator._not, q);
}