在 Spring @Cacheable
注释我想指定一个 unless
条件。
但是我的返回值既不是原始类型也不是 Java bean,而是一个枚举。
如何与 SpEL 中的另一个 Enum(Spring 表达式语言)比较相等性?
最佳答案
#result == T(fully.qualified.path.to.AnEnum).A_VALUE
引用 here :
You can use the special T operator to specify an instance of java.lang.Class (the type).
https://stackoverflow.com/questions/21806298/
相关文章:
java - 如何在spring mvc中使用带有freemarker的消息?
spring - 配置多个数据源后无法设置JPA命名策略(Spring 1.4.1/Hibernat
java - @ControllerAdvice 在处理异常方面比 @ExceptionHandle
java - 为什么 Spring 的 jdbcTemplate.batchUpdate() 这么慢
java - 使用 restAssured 测试 Spring Boot Rest 应用程序
java - AspectJ 表达式在切入点错误中给出正式的未绑定(bind)