gpt4 book ai didi

java - SimpleIllegalSyntaxException : is operator cannot find class with name:

转载 作者:行者123 更新时间:2023-12-02 11:41:28 25 4
gpt4 key购买 nike

我试图通过调用该方法来检查 when 中的 Camel 选择条件,但失败并引发异常。请帮助我检查具有常量值的方法返回值。

异常(exception):

SimpleIllegalSyntaxException: is operator cannot find class with name: VS at location 22 ${body.recType} is 'VS'

路线:

from("direct:processAccounts").process(filterProcessor). 
split(simple("${body}")).choice().when().
simple("${body.recType} is 'VS'").
process((exchange) -> {log.info("VS:");}).otherwise().to("stream:out");

Java 类:

public class Records{

private String recType;
// getters and setters
}

最佳答案

is 运算符类似于 Java 中的 instanceof。如果您想对字符串值进行等于比较,请使用

simple("${body.recType} == 'VS'").

查看简单文档:http://camel.apache.org/simple

关于java - SimpleIllegalSyntaxException : is operator cannot find class with name:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48520209/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com