设为首页 加入收藏

TOP

使用 Java 注解自动化处理对应关系实现注释代码化(三)
2018-04-14 06:06:19 】 浏览:632
Tags:使用 Java 注解 自动化 处理 对应 关系 实现 注释 代码
Object> getShouldTermFilter() { return Collections.unmodifiableMap(shouldTermFilter); } public Map<String, Match> getMatchFilter() { return matchFilter; } public void setShouldMatchMinimum(Integer shouldMatchMinimum) { this.shouldMatchMinimum = shouldMatchMinimum; } public Integer getShouldMatchMinimum() { return shouldMatchMinimum; } public Map<String, Object> getRangeMap(String key) { return Collections.unmodifiableMap(rangeFilter.get(key).toMap()); } public List<String> getIncludes() { return Collections.unmodifiableList(includes); } public boolean isNeedFilterLayer() { return isNeedFilterLayer; } public void setNeedFilterLayer(boolean needFilterLayer) { isNeedFilterLayer = needFilterLayer; } @Override public boolean equals(Object o) { // for you to write } @Override public int hashCode() { // for you to write }

小结

通过ES搜索示例,展示了如何运用注解自动化处理领域对象属性与底层ES存储字段之间的对应关系。实际上,如果想为应用对象或组件添加某种说明或注释,不妨先想想是否可以通过注解自动化处理。注解亦可用于框架自动处理对象与组件的集成。Spring框架的Resource, Component, AOP,以及 Plugin 化设计思想等都是好的应用例子。

首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Java 虚拟机16:Metaspace 下一篇Spring 中获取 request 的几种方..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目