MCPcopy Create free account
hub / github.com/Bit0r/java-util / CommonUtils

Class CommonUtils

src/main/java/util/CommonUtils.java:48–688  ·  view source on GitHub ↗

通用相关 工具类 @author zhichong @since 2020-06-10

Source from the content-addressed store, hash-verified

46 * @since 2020-06-10
47 */
48public class CommonUtils {
49
50 private static Logger logger = LoggerFactory.getLogger(CommonUtils.class);
51
52// /**
53// * 模糊查询
54// *
55// * @param queryWrapper
56// * @param blurryMap
57// * @param object
58// * @return
59// */
60// private static QueryWrapper<Object> getBlurryMap(QueryWrapper<Object> queryWrapper, Map<String, Object> blurryMap, Object object) {
61// if (blurryMap == null || blurryMap.isEmpty()) {
62// return queryWrapper;
63// }
64// Iterator<Map.Entry<String, Object>> iterator = blurryMap.entrySet().iterator();
65// Set<String> keySet = new HashSet<>();
66// while (iterator.hasNext()) {
67// Map.Entry<String, Object> entry = iterator.next();
68// String key = entry.getKey();
69// String value = String.valueOf(entry.getValue());
70// if (StringUtils.isNotEmpty(value)) {
71// keySet.add(key);
72// }
73// }
74// HashMap<String, Object> hashMap = getProxyPojoValue(object, keySet);
75// for (String data : keySet) {
76// String value = (String) blurryMap.get(data);
77// String fieldName = (String) hashMap.get(data);
78// if (StringUtils.isEmpty(fieldName)) {
79// fieldName = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, data);
80// }
81// queryWrapper.like(fieldName, value);
82// }
83// return queryWrapper;
84// }
85//
86// /**
87// * 精确查询
88// *
89// * @param queryWrapper
90// * @param accurateMap
91// * @param object
92// * @return
93// */
94// private static QueryWrapper<Object> getAccurateMap(QueryWrapper<Object> queryWrapper, Map<String, Object> accurateMap, Object object) {
95// if (accurateMap == null || accurateMap.isEmpty()) {
96// return queryWrapper;
97// }
98// Iterator<Map.Entry<String, Object>> iterator = accurateMap.entrySet().iterator();
99// Set<String> keySet = new HashSet<>();
100// while (iterator.hasNext()) {
101// Map.Entry<String, Object> entry = iterator.next();
102// String key = entry.getKey();
103// String value = String.valueOf(entry.getValue());
104// if (StringUtils.isNotEmpty(value)) {
105// keySet.add(key);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected